2015-12-05 76 views
0

好吧,所以我真的很新。几个小时前,我将样式类“P”设置为css风格类别不变

...// <Style> 
      P {color:black, font-size: 16pt;} 
...// </Style> 

并且我认为它可能会破坏某些东西!我所有的其他代码行都在工作,但是这个!我认为它会使每个默认的新段落黑色16pt ......但它不会让我改变颜色。

.need1类未被正确调用,并显示为先前设置的黑色16pt,而不是中心的24位红色,粗体文本的.need1类。

此外,Jfiddler保持tellng我

</P> 

的收盘不当,所以我把他们赶走,但我应该把它们放回去?我已经尝试了两种方法,但并未解决问题。

<STYLE>. 

      .red1 {color: #ff0000} 
      .orange1 {color: } 
      .blue1 
      .green1 
      .need1 {font-size:24pt; color:red; font-weight: bold; text-align:center} 
      .need2 {font-size:16pt; color:red;} 
      .want {font-size:16pt; color:orange} 
      .fun {font-size:14pt; color:green} 
      .cata {font-size:20pt; color:black; font-weight: bold; text-decoration:underline; text-align: left} 
      .specs1 {font-size:20pt; color:blue; font-weight:bold; text-align:center; text-decoration: underline} 
      .specs2 {font-size:16pt; color: blue; text-align:center} 
      .head {font-size:28pt; color:purple; text-align:center; 
        text-decoration:underline; font-weight: bold} 
      .ex {font-size: 18; color:black; text-align: right} 

      a:link {color:blue; background-color:transparent; text-decoration:none} 
      a:visited {color:purple; background-color:transparent; text-decoration:none} 
      a:hover {color:red; background-color:transparent; text-decoration:underline} 
      a:active {color:yellow; background-color:transparent; text-decoration:underline} 
</STYLE>. 

<P Class = "head"> TEXT 
</P> 

<P Class = "need1"> TEXT 
    <BR>TEXT <span Class = "red1">TEXT</span> TEXT 

    <BR>TEXT 
    <BR> 
    <BR>TEXT 


<P Class = "cata"> 
    TEXT 
</P> 
<P> 
    <BR>TEXT = <span class= "red1">RED</span> 
    <BR>TEXT = ORANGE 
    <BR>TEXT = 


<P Class = "head"> 
     TEXT[Jfiddle Screencapture][1] 
</P> 

enter image description here

+0

为什么额外此代码后。风格标签之前和之后? –

+0

不要在class =“”之间有空格,这可能对你有帮助 – MasterT

+0

我不确定如何在网站的文本框中输入代码,而不会变成代码大声笑!我想出了CTRL + K我认为。立即尝试您的建议,马上回来! – Hroki702

回答

0

尝试使用后的重要

P {color:black !important; font-size: 16pt !important;} 

,但首先你要纠正你的代码,错误示例:“”为什么你写风格之后,你必须写下“;”在css atributes之间不是“。” 固定

P {color:black !important; font-size: 16pt !important;} 
 
      .red1 {color: #ff0000} 
 
      .orange1 {color: } 
 
      .blue1 
 
      .green1 
 
      .need1 {font-size:24pt; color:red; font-weight: bold; text-align:center} 
 
      .need2 {font-size:16pt; color:red;} 
 
      .want {font-size:16pt; color:orange} 
 
      .fun {font-size:14pt; color:green} 
 
      .cata {font-size:20pt; color:black; font-weight: bold; text-decoration:underline; text-align: left} 
 
      .specs1 {font-size:20pt; color:blue; font-weight:bold; text-align:center; text-decoration: underline} 
 
      .specs2 {font-size:16pt; color: blue; text-align:center} 
 
      .head {font-size:28pt; color:purple; text-align:center; 
 
        text-decoration:underline; font-weight: bold} 
 
      .ex {font-size: 18; color:black; text-align: right} 
 

 
      a:link {color:blue; background-color:transparent; text-decoration:none} 
 
      a:visited {color:purple; background-color:transparent; text-decoration:none} 
 
      a:hover {color:red; background-color:transparent; text-decoration:underline} 
 
      a:active {color:yellow; background-color:transparent; text-decoration:underline}
<P class = "head"> TEXT 
 
</P> 
 

 
<P Class = "need1"> TEXT 
 
    <BR>TEXT <span Class = "red1">TEXT</span> TEXT 
 

 
    <BR>TEXT 
 
    <BR> 
 
    <BR>TEXT 
 

 

 
<P Class = "cata"> 
 
    TEXT 
 
</P> 
 
<P> 
 
    <BR>TEXT = <span class= "red1">RED</span> 
 
    <BR>TEXT = ORANGE 
 
    <BR>TEXT = 
 

 

 
<P Class = "head"> 
 
     TEXT[Jfiddle Screencapture][1] 
 
</P>

0

广场色后一个分号,你有一个逗号,而不是。 P {color:black,font-size:16pt;}更改为P {color:black; font-size:16pt;}更改为P {color:black; font-size:16pt;}

希望有所帮助!

0

第二和第四个p标签没有匹配的结束标签,BR标签更改也一样,它也可以删除“。”。 !风格的打开和关闭标签