标签选择器
标签选择器 :如input{border-color:Yellow;color:Red;},对于指定的标签采用统一的样式,只要是这个标签,选择器就适用
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title></title> 6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 7 <style type = "text/css"> 8 input 9 { 10 width:200px; 11 color:Red; 12 } 13 </style> 14 </head> 15 <body> 16 <!--使所有标签具有相同的样式,如果为每个标签都设置style属性,太麻烦了--> 17 <input type="text" /> 18 <input type="text" /> 19 <input type="text" /> 20 <input type="text" /> 21 <input type="text" /> 22 <input type="text" /> 23 <input type="text" /> 24 </body> 25 </html>
但是实际中input标签还有<input type= "radio" />、<input type= "submit" />等,标签选择器就不合适了。
所以引出了class选择器。
浙公网安备 33010602011771号