Home  >  Article  >  Web Front-end  >  css style reset

css style reset

王林
王林forward
2020-10-23 15:51:492384browse

css style reset

Personal understanding of CSS reset:

(Recommended tutorial: css video tutorial)

First of all, I think Like me, I have no sense of understanding concepts. If a front-end novice who is easily confused wants to understand what css reset style is, he must understand two concepts: CSS Reset and css reset (in fact, the concepts are very similar, but there are still differences. ), otherwise I would just know that the css style needs to be reset, but I don’t know why. For someone like me who has a bit of obsessive-compulsive disorder about concepts, not knowing it is really painful. (Hahaha, stop talking and get to the point)

As far as my own understanding is concerned, css reset style sheet can be divided into the following three questions:

(1) What is CSS reset? Why use CSS Reset?

(2) Why reset CSS?

Okay, the question has been raised, and it’s time for me to talk about my own understanding: (1) CSS Reset simply means to reset the css properties according to the needs of our own pages (nonsense, of course) Everyone knows! But what I want to focus on is the reason for css reset~) CSS reset is mainly because html tags have their own default styles in the browser, for example: p tag has top and bottom margins, strong tag has font plus Bold style, em tag has font italic style. There are also differences between the default styles of different browsers. For example, ul has an indented style by default. Under IE, its indentation is achieved by margin, while under Firefox, its indentation is achieved by padding. . When switching pages, the browser's default style often causes us trouble and affects development efficiency. So the solution is to remove all the browser's default styles from the beginning, or more precisely, by redefining the label style. "Override" the browser's CSS default properties. The simplest way is to overwrite the default style provided by the browser! This is CSS reset.

(2) When it comes to why you need to reset css, this point starts from the browser, because different browsers have different interpretations of html tags. Resetting css can make html tags appear in different browsers. produces the same performance effect.

I think it is necessary to post the css reset style code at this time, otherwise wouldn’t it be useless to talk nonsense for a long time? After all, it's not very suitable for us to be wordy.

Related recommendations: CSS tutorial

The above is the detailed content of css style reset. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete