Maquetacion Resetear CSS

Categories: CSS, Diseño - Tags: ,

¿Por qué resetear el CSS?

Los navegadores por defecto tienen algunos estilos predefinidos, como márgenes, padding, tamaño de linea, etc lo que puede resultar en un dolor de cabeza cuando las páginas lucen distintas entre uno y otro browser, por eso suele ser una buena primero resetear el css.

Resetear CSS forma completa

Personalmente no uso esta forma porque es un tanto extensa y normalmente no se requiere resetear tantas cosas pero si vas a usar un CSS framework o quieres estar bien seguro que todos los estilos están en cero, pues puedes revisar esta pagina, a continuación copio lo más importante

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

La forma reducida de resetear

Normalmente con resetear los margenes y padding suele ser suficiente, no olvides que si pones tablas con align=”center” no funcionarán a menos que además les pongas margin:auto

1
2
3
4
* {
  padding:0px;
  margin:0px;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*


- four = 2

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>