梦之都
CSS教程
,
CSS E[att$=val] 属性值子串选择符
示例,[att$=val]匹配文档中元素的属性att的值的后缀为val的元素,匹配不同的链接文件
梦之都红色字体
梦之都绿色字体
梦之都蓝色字体
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>CSS E[att$=val] 属性值子串选择符示例,匹配不同的链接文件</title> <style type="text/css" media="all"> a[href$=".html"] { color:red; } a[href$=".php"] { color:green; } a[href$=".jsp"] { color:blue; } </style> </head> <body> <a href="http://www.dreamdu.com/css.html">梦之都红色字体</a> <a href="http://www.dreamdu.com/css.php">梦之都绿色字体</a> <a href="http://www.dreamdu.com/css.jsp">梦之都蓝色字体</a> </body> </html>