Are margins and additions the most unbalanced thing among all browsers?

While some people use this reset. * {margin: 0; filling: 0; }

Does each element have a default margin and addition in each default stylesheet for the browser (but in different ways)?

While eric meyer put together some of the most used selectors and gave it to everyone

{ margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } 

Are these elements different types of fonts? different baselines, different background, outline and borders?

if we save, except for the minuses of the universal selector.

- this is

 * { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } 

better than that

 * { margin: 0; padding: 0; } 
+2
css
source share
3 answers

Here you can find all the default styles: CSS2.1 The element of the User Agent default property table .

If you carefully examine the list, you will notice that the browser-specific fields are set only for HTML-standard block elements and that no browser add-on is specified anywhere. In other words, padding: 0 is redundant. But really, margin is the most unbalanced among browsers to answer your real question.

I'm probably going to step on someone's toes, but in my humble opinion, using CSS reset styles is ridiculous. In any case, you will have to redefine most of these fields (and gaskets). You can study and save the rule as best as possible in order to define a marker (and, if necessary, a registration) for each element of the block that you are going to use in the document.

As for the rest of reset:

  • border: 0 also supernatural. The <hr> elements and most input elements are the only elements that have a default border. Without it, <hr> invisible (in fact, this does not work in IE6 / 7), and text input elements in the form with the same background color are also invisible.

  • outline certainly does not need to be reloaded, this violates accessibility. You must control it yourself, for example. dropping it yourself only on links with a (background) image, since this is the main reason for resetting it. But still this violates accessibility. Rather, consider giving it a different color or outline style so that it is still visible, but less disturbing.

  • font-size: 100% will force you to override them yourself in the <h1> , <h2> elements, etc. But even without reset, you often would like to do this. What is the point of this reset then?

  • vertical-align: baseline; breaks the alignment of <sub> and <sup> so that they look like <small> . In addition, table headers may be affected. These defaults are middle in all browsers. You will need to redefine them again. In addition, it is known that this reset can cause IE6 / 7 to destroy images.

  • Value background: transparent; it is not clear to me. I see no reason for this reset to expect this to make IE6 / 7 crazy. You will also need to override the background color for all form input elements yourself, which will add more work (for the case when they are placed in a color container). I am sure that whenever you come across an element that needs a transparent background, you can easily determine it yourself and install it yourself.

Enfin, look what you do with this information. I did not stop you from using CSS reset. I myself found CSS reset only useful> 10 years ago when I was just starting out with HTML / CSS. But over the years and years, I also found out that this is empty stupidity. But I admit that this is useful for beginners, since reset will force them to explicitly specify fields and other things. What could you do just as well without reset.

+5
source share

Well, “better than that” is hard to say, but one who has more material does more.

outline 0 causes links to not have a dashed border around them.

Border 0 creates images and has no border around them.

font-size: 100% probably does something like providing fonts 100%.

vertical-align: the baseline sets all the vertical alignments at the bottom of the container,

background: transparent prevents some png problems.

but margin: 0 and padding: 0 are two that defiantly should not be omitted from your reset list.

0
source share

Short answer: Feel free to install all those if you are ready to redefine it for any item that you may need later.

However, note that there can be a lot of work ahead of you when it comes to form elements. They require that at least the border look good, and some of them (like buttons) need to be complemented. In addition, some browsers display a three-dimensional border around the default buttons. If you set the border to 0, you cannot get this 3D view using CSS.

Alternatively, you can check out http://www.blueprintcss.org/ . It aligns browsers well enough, it seems, although I have not tried it myself.

0
source share

All Articles