Priority algorithm when CSS rules are cascading

WBOY
Release: 2018-09-27 15:58:53
Original
1467 people have browsed it

the priority of css rules is a concept that web front-end developers must understand. there are four commonly used methods for adding styles.

1. inline style
2. embedded style
3. external style
4. user style

inline style is ugly, they shuttle in html documents, they are tangled with html elements, causing a lot of trouble for web front-end developers. they often appear like this:

<p style="color:red;">this is a paragraph.</p>
Copy after login

embeded style is more gentlemanly than inline style. they also reside in html documents, but they disdain to be tangled with html elements. they often appear in the