p1{ </span></li><li class=""><span>color:blue;/*<span class="tag"><</span><span class="tag-name">span</span><span> </span><span class="attribute">style</span><span>=</span><span class="attribute-value">"font-family:"</span><span>;"</span><span class="tag">></span><span>1</span><span class="tag"></</span><span class="tag-name">span</span><span class="tag">></span><span>没加important 显示为红色 */ </span></span></li><li class="alt"><span>} </span></li><li class=""><span>} </span></li><li class="alt"><span>.p2{ </span></li><li class=""><span>color:blue; </span></li><li class="alt"><span>color:red!important;/*2加上了important属性优先级高 显示为红色 */ </span></li><li class=""><span>} </span></li><li class="alt"><span>.p3{ </span></li><li class=""><span>color:red!important; </span></li><li class="alt"><span>color:blue;/*3但是这种情况下在ie6一下ie版本会显示为蓝色但是在其他浏览器都显示为红色 */ </span></li><li class=""><span> </span></li><li class="alt"><span>} </span></li><li class=""><span>/*4为了解决ie6及一下版本的兼容 把样式分开写 important的优先级高 显示为红色 */ </span></li><li class="alt"><span>.p4{ </span></li><li class=""><span>color:red!important; </span></li><li class="alt"><span>} </span></li><li class=""><span>.p4{ </span></li><li class="alt"><span>color:blue; </span></li><li class=""><span>} </span></li><li class="alt"><span> </span></li><li class=""><span><span class="tag"></</span><span class="tag-name">style</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">head</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">body</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">p</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"p1"</span><span class="tag">></span><span>1没加important</span><span class="tag"></</span><span class="tag-name">p</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">p</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"p2"</span><span class="tag">></span><span>2加了important属性</span><span class="tag"></</span><span class="tag-name">p</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">p</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"p3"</span><span class="tag">></span><span>3IE6及一下版本识别不出来</span><span class="tag"></</span><span class="tag-name">p</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">p</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">"p4"</span><span class="tag">></span><span>4解决ie6及一下版本的兼容问题</span><span class="tag"></</span><span class="tag-name">p</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">body</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"></</span><span class="tag-name">html</span><span class="tag">></span><span> </span></span></li></ol></div><div class="dp-highlighter bg_html" style="position: relative; "><div class="bar"><div class="tools"><b>[html]</b> <a href="#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view plain</a><a href="#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy</a><a href="#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a href="#" class="About" title="?" onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a><div style="position: absolute; left: 123px; top: 1372px; width: 16px; height: 16px; z-index: 99; "><embed id="ZeroClipboardMovie_2" src="https://static-blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16" height="16" name="ZeroClipboardMovie_2" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=16&height=16" wmode="transparent"></div><div style="position: absolute; left: 123px; top: 1372px; width: 16px; height: 16px; z-index: 99; "><embed id="ZeroClipboardMovie_4" src="https://static-blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16" height="16" name="ZeroClipboardMovie_4" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=4&width=16&height=16" wmode="transparent"></div></div></div><ol start="1" class="dp-xml"><li class="alt"><span><span><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">html</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">head</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">meta</span><span> </span><span class="attribute">http-equiv</span><span>=</span><span class="attribute-value">"Content-Type"</span><span> </span><span class="attribute">content</span><span>=</span><span class="attribute-value">"text/html; charset=UTF-8"</span><span class="tag">></span><span> </span></span></li><li class="alt"><span><span class="tag"><</span><span class="tag-name">title</span><span class="tag">></span><span>Insert title here</span><span class="tag"></</span><span class="tag-name">title</span><span class="tag">></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">style</span><span> </span><span class="attribute">type</span><span>=</span><span class="attribute-value">"text/css"</span><span class="tag">></span><span> </span></span></li><li class="alt"><span>.
Back to home |
File page
Subscribe |
Register |
Login
| N