Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of this CSS snippet?

Tags:

html

css

I have the following snippet in my stylesheet. What is the impact or purpose?

* {
    margin:0;
    padding:0;
    top: 0px;
    left: 0px;
}
like image 257
FiveTools Avatar asked Aug 12 '11 14:08

FiveTools


People also ask

What is a snippet in CSS?

Code snippets are blocks of code that are usually: Shared between developers. Added to articles and blog posts, like this one.

What is the use of snippets?

Snippets are short, reusable text blocks that can be used on contact, company, deal and ticket records, in email templates, in chat conversations, and when logging an activity or note. If you want to create reusable emails, learn more about the templates tool.

What is a snippet in HTML?

An HTML snippet is an array consisting of a series of elements that format the HTML tree. Those elements are one of two things: either a string, which represents text to be included in the snippet, or an array, which represents an HTML tag to be included.

What is snippet in JavaScript?

Snippets are scripts that you author in the Sources panel. They have access to the page's JavaScript context, and you can run them on any page. Snippets are an alternative to bookmarklets. Firefox DevTools has a feature similar to Snippets called Scratchpad.


1 Answers

It is a reset. All elements will have 0 margin, padding, etc. after that.

Such resets are useful to normalize behavior (some browsers come with predefined margins, paddings, etc.) and to increase visual consistency across browsers.

like image 83
miku Avatar answered Nov 05 '22 22:11

miku