Código CSS de base para inicializar el layout

Código CSS a poner en un archivo llamado base.css (por ejemplo) y cuya función es inicializar todos los atributos del layout de una página a unos valores más o menos estándar. Esto por lo tanto favorece la programación CSS cross-browser.

/*
BASE.CSS
attempts to set all layout attributes to the absolute basics, so that inbuilt
browser formatting won’t produce un-expected results (i.e. incosistant padding
values on across different browsers wont catch you out, because we set them all
here)
——————————————————————————–
*/

* {
padding:0;
margin:0;
font-family:""Times New Roman"", Times, serif;
font-size:100%;
color:#000000;
}
body {
padding:5px;
}
h1, h2, h3, h4, h5, h6, p, pre, blockquote, form, label, ul, ol, dl, fieldset, address {
margin:.5em 0;
}
/* SORT OUT HEADER FORMATTING AND SIZES */
h1, h2, h3, h4, h5 { font-weight: bold; }
h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.2em; }
h5 { font-size: 1.1em; }
h6 { font-size: 1em; }
a img,:link img,:visited img {
border:none
}
/* HARMONIZE LINKS, KILL BORDER ON IMG LINKS */
a {text-decoration: underline;}
a:link, a:visited {color: #00f;}
a:hover {color: #33f;}
a:active {color: #fff;}
a img, :link img, :visited img {border: none}

/* REMOVE BROWSERS DEFAULT TABLE BORDERS */
table {border-collapse: collapse;}

/* REMOVE AUTOMATIC TOP/BOTTOM MARGINS ON NESTED LISTS */
ul ul, ul ol, ul dir, ul menu, ul dl,
ol ul, ol ol, ol dir, ol menu, ol dl,
dir ul, dir ol, dir dir, dir menu, dir dl,
menu ul, menu ol, menu dir, menu menu, menu dl,
dl ul, dl ol, dl dir, dl menu, dl dl
{ margin-top: 0; margin-bottom: 0; }

/* HARMONISE LIST-BULLET TYPE */
ul, ol, dl { list-style-type: disc; }

/* HARMONISE LIST MARGIN */
li, dd, blockquote {
margin: 0 0 0 2em;
_margin: 0 0 0 2em;
}
/* HARMONISE FIELDSET & LEGEND PADDING */
fieldset {
padding: 1em 1em 1em 1em;
}
legend {
margin: 0 0 0 0;
_margin: -.5em 0 .9em 0;
}

Guarda   |   Imprime   |   Recomienda

  • E-mail this story to a friend!
  • Print this article!
  • Turn this article into a PDF!
  • RSS
  • Google Bookmarks
  • Technorati
  • Meneame
  • Digg
  • TwitThis
  • MySpace
  • Yahoo! Bookmarks
  • del.icio.us
  • Facebook
  • Bitacoras.com
  • Live
  • StumbleUpon
  • Wikio
  • Netvibes
  • BarraPunto

Publicar un comentario

Si es la primera vez que escribes, tu comentario será moderado por un administrador.

Con el fin de garantizar un ambiente de debate respetuoso, no se permitirán comentarios:

  • insultantes, difamatorios, racistas, sexistas, y/o discriminatorios
  • excesivamente críticos con otros participanes
  • que no aporten nada, sin sentido o repetidos
  • con enlaces considerados publicidad o spam
  • con material protegido por derechos de autor
*
*