属性选择器
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>属性选择器</title> <style type="text/css"> /* 属性选择器 根据元素的属性来选中元素 [属性名]获取含有指定属性的元素 */ [title]{ width: 200px; height: 100px; background-color: #87CEEB; } </style> </head> <body> <p title="hello">我是一个p元素</p> </body> </html>
本文来自博客园,作者:氯丙嗪,转载请注明原文链接:https://www.cnblogs.com/YcxyH/p/16246434.html