Home  >  Article  >  Web Front-end  >  Which one has higher priority, id or style_html/css_WEB-ITnose

Which one has higher priority, id or style_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:40:551270browse

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/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn