武汉web培训
达内武汉中心

15271940953

热门课程

武汉web培训:CSS伪类

  • 时间:2016-05-20
  • 发布:tQuery
  • 来源:web前端网

<DIV>这篇是写在博客园里的,被google收录了,而且很多钓鱼网页采集了,比如51js</DIV>
<DIV>伪类 
<P><EM>浏览器支持</EM>:<EM>IE</EM> Internet Explorer, <EM>F</EM>: Firefox, <EM>N</EM>: Netscape。</P>
<P><EM>W3C</EM>:“W3C” 列的数字显示出伪类属性由哪个 CSS 标准定义(CSS1 还是 CSS2)。</P>
<P>
<TABLE border=1 .="dataintable">
<TBODY>
<TR bgColor=#eeeeee>
<TH>伪类</TH>
<TH>作用</TH>
<TH>IE</TH>
<TH>F</TH>
<TH>N</TH>
<TH>W3C</TH></TR>
<TR>
<TD>:active</TD>
<TD>将样式添加到被激活的元素</TD>
<TD>4</TD>
<TD>1</TD>
<TD>8</TD>
<TD>1</TD></TR>
<TR>
<TD>:focus</TD>
<TD>将样式添加到被选中的元素</TD>
<TD>-</TD>
<TD>-</TD>
<TD>-</TD>
<TD>2</TD></TR>
<TR>
<TD>:hover</TD>
<TD>当鼠标悬浮在元素上方时,向元素添加样式</TD>
<TD>4</TD>
<TD>1</TD>
<TD>7</TD>
<TD>1</TD></TR>
<TR>
<TD>:link</TD>
<TD>将特殊的样式添加到未被访问过的链接</TD>
<TD>3</TD>
<TD>1</TD>
<TD>4</TD>
<TD>1</TD></TR>
<TR>
<TD>:visited</TD>
<TD>将特殊的样式添加到被访问过的链接</TD>
<TD>3</TD>
<TD>1</TD>
<TD>4</TD>
<TD>1</TD></TR>
<TR>
<TD>:first-child</TD>
<TD>将特殊的样式添加到元素的第一个子元素</TD>
<TD>&nbsp;</TD>
<TD>1</TD>
<TD>7</TD>
<TD>2</TD></TR>
<TR>
<TD>:lang</TD>
<TD>允许创作者来定义指定的元素中使用的语言</TD>
<TD>&nbsp;</TD>
<TD>1</TD>
<TD>8</TD>
<TD>2</TD></TR></TBODY></TABLE></P>
<P><FONT face="Courier New"><SPAN .="COLOR: #800000">&lt;style type="text/css"&gt;<BR>a:link </SPAN><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">color</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff"> #FF0000</SPAN><SPAN .="COLOR: #000000">}</SPAN><SPAN .="COLOR: #800000"> </SPAN><SPAN .="COLOR: #008000"></SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">a:visited </FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">color</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff"> #00FF00</SPAN><SPAN .="COLOR: #000000">}</SPAN><SPAN .="COLOR: #800000"> </SPAN><SPAN .="COLOR: #008000"></SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">a:hover </FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">color</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff"> #FF00FF</SPAN><SPAN .="COLOR: #000000">}</SPAN><SPAN .="COLOR: #800000"> </SPAN><SPAN .="COLOR: #008000"></SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">a:active </FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">color</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff"> #0000FF</SPAN><SPAN .="COLOR: #000000">}</SPAN><SPAN .="COLOR: #800000"> </SPAN><SPAN .="COLOR: #008000"></SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">input[type="text"]:focus</FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">border</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">1px solid #f33</SPAN><SPAN .="COLOR: #000000">;</SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT><FONT face="Courier New"><SPAN .="COLOR: #800000"> <BR>input[type="button"]:hover</SPAN><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">color</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">#f00</SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">table</FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">width</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">400px</SPAN><SPAN .="COLOR: #000000">;</SPAN><SPAN .="COLOR: #ff0000"> border</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">1px solid #ccc</SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">td</FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">border</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">1px solid #ccc</SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">td:first-child</FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">color</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">#f00</SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">tr:hover</FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #000000">{</SPAN><SPAN .="COLOR: #ff0000">background</SPAN><SPAN .="COLOR: #000000">:</SPAN><SPAN .="COLOR: #0000ff">#eee</SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT><SPAN .="COLOR: #800000"><BR><FONT face="Courier New">q:lang(no)</FONT></SPAN><SPAN .="COLOR: #000000"><FONT face="Courier New">{</FONT></SPAN><SPAN .="COLOR: #ff0000"><BR><FONT face="Courier New">quotes</FONT></SPAN><SPAN .="COLOR: #000000"><FONT face="Courier New">:</FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">"~" "~"<BR></SPAN><SPAN .="COLOR: #000000">}</SPAN></FONT></P>
<DIV .="cnblogs_code" .click="cnblogs_code_show('def7f6a3-0fd8-4c27-9179-497304812fe1')"><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">p</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR><FONT face="Courier New"></FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">a </SPAN><SPAN .="COLOR: #ff0000">href</SPAN><SPAN .="COLOR: #0000ff">="http://tomieric.tk"</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">tomieric</SPAN><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">a</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">p</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><FONT face="Courier New"><SPAN .="COLOR: #000000"> <BR></SPAN><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">p</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR><FONT face="Courier New"></FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">input </SPAN><SPAN .="COLOR: #ff0000">type</SPAN><SPAN .="COLOR: #0000ff">="text"</SPAN><SPAN .="COLOR: #ff0000"> name</SPAN><SPAN .="COLOR: #0000ff">="text1"</SPAN><SPAN .="COLOR: #ff0000"> value</SPAN><SPAN .="COLOR: #0000ff">=""</SPAN><SPAN .="COLOR: #ff0000"> </SPAN><SPAN .="COLOR: #0000ff">/&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR><FONT face="Courier New"></FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">input </SPAN><SPAN .="COLOR: #ff0000">type</SPAN><SPAN .="COLOR: #0000ff">="button"</SPAN><SPAN .="COLOR: #ff0000"> name</SPAN><SPAN .="COLOR: #0000ff">="submit"</SPAN><SPAN .="COLOR: #ff0000"> value</SPAN><SPAN .="COLOR: #0000ff">="确定"</SPAN><SPAN .="COLOR: #ff0000"> </SPAN><SPAN .="COLOR: #0000ff">/&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">p</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><FONT face="Courier New"><SPAN .="COLOR: #000000"> <BR></SPAN><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">p</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">这是测试</SPAN><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">q </SPAN><SPAN .="COLOR: #ff0000">lang</SPAN><SPAN .="COLOR: #0000ff">="no"</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">博客园</SPAN><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">q</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN .="COLOR: #800000">p</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">table</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR><FONT face="Courier New"></FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">tr</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">第一行</SPAN><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">第一行</SPAN><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;/</SPAN><SPAN .="COLOR: #800000">tr</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR><FONT face="Courier New"></FONT></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;</SPAN><SPAN .="COLOR: #800000">tr</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">第2行</SPAN><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN><SPAN .="COLOR: #000000">第一行</SPAN><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">td</SPAN><SPAN .="COLOR: #0000ff">&gt;&lt;/</SPAN><SPAN .="COLOR: #800000">tr</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT><SPAN .="COLOR: #000000"><BR></SPAN><FONT face="Courier New"><SPAN .="COLOR: #0000ff">&lt;/</SPAN><SPAN .="COLOR: #800000">table</SPAN><SPAN .="COLOR: #0000ff">&gt;</SPAN></FONT></DIV></DIV>
上一篇:武汉web培训:jquery复习
下一篇:在制作Xhtml页面时是先写HTML代码还是先写CSS代码

web前端学习容易犯的错误

web1702“诱人”活动

抽象类和抽象方法

jquery的ajax和getJson跨域获取json数据

选择城市和中心
贵州省

广西省

海南省