Home >Web Front-end >HTML Tutorial >Which one has higher priority, id or style_html/css_WEB-ITnose
Which priority is higher, id or style:
Everyone knows that the id selector has a higher priority, and the style written directly in the tag also has a very high priority. level, you may compare the two to see which one has the higher priority. Let’s use an example to introduce which one has the higher priority. The code example is as follows:
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.51texiao.cn/" /><title>蚂蚁部落</title><style type="text/css">#mytest{ colors:green;}</style></head><body><div id="mytest" style="color:red">蚂蚁部落</div></body></html>
The original address is: http://www.51texiao.cn/div_cssjiaocheng/2015/0503/592.html
The most original The address is: http://www.softwhy.com/