Home > Web Front-end > HTML Tutorial > 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
Release: 2016-06-24 11:40:55
Original
1312 people have browsed it

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>
Copy after login

The original address is: http://www.51texiao.cn/div_cssjiaocheng/2015/0503/592.html

The most original The address is: http://www.softwhy.com/

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template