<!-- ---------------------
MAQUETACIÓN FIJA Y LÍQUIDA
---------------------- -->
<div id="contenedorFijo">
<h1>
Maquetación fija
</h1>
<h2>
El width de una maqueta fija debe ser dado en px (píxeles)
</h2>
<p>
Una medida standard puede ser 960px si consideras que tu resolución mínima parte de un monitor de 1024px de ancho. O bien puedes hacerlo de 760px si partes de un monitor de 800px de ancho.
</p>
</div>
<div id="contenedorLiquido">
<h1>
Maquetación líquida
</h1>
<h2>
El width de una maqueta líquida debe ser dado en % (porcentaje)
</h2>
</div>
<div id="liquido">
<div id="fijo"> contenedor líquido y contenido fijo</div>
</div>
<!--
Finalmente están las maquetas "elásticas" que usan como unidad de medida "em" (en lugar de px o %). Sinceramente nunca las he trabajado por no encontrarlas aún útiles en mis proyectos.
Pero aquí un artículo sobre el tema: http://www.100px.com/articulos/ni_fijo_ni_liquido_elastico
-->
CSS
/*general*/
h1, h2 {font-size:2em; font-weight:bold;} h2{font-size:1.5em;}
/*layout*/
#contenedorFijo{
width:250px;
background:#c8c8c8;
margin:0 auto; /*si quieres que se centre horizontalmente*/
}
#contenedorLiquido{
width:70%;
background:#04B4AE;
margin:0 auto; /*si quieres que se centre horizontalmente*/
} /*luego damos width con % también a sus elementos anidados*/
/* usamos fijo y líquido */
#liquido{
width:100%;
background:black;
}
#fijo{
width:250px;
background:gray;
margin:0 auto;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.