L'objectiu que hem de perseguir sempre és definir la estructura de la informació en llenguatge HTML i l'aspecte amb que volem que es representi en CSS, i si pot ser en una fulla externa. Us poso a continuació els passos que podríem seguir per aconseguir dissenyar una pàgina.
- Muntem la estructura HTML.
- Li connectem la fulla d'estils externa.
No és obligatori però és pràctic.
Si de cas enrecordeu-vos de posar el IE7.js per que no tinguem problemes amb els Internet explorer 5.1, 5.5 i 6 a l'hora de representar les capses.
- A la fulla d'estils fem:
* { /*margin:0; padding:0;*/
/* Aquí definim aspectes globals que no admetin herència i que els vulguem a qualsevol contenidor. */
}
html, body {height:100%; margin: 0px;
padding: 0px;}
/* aconseguim que body arribi de dalt a baix */
body {
background-color: #666666; background-image:url(fons.png);
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a {text-decoration:none;}
a:link {color:#333333;}
a:visited {color:#333333;}
a:hover {color:#cc0000;}
a:active{color:#ff3300;}
p {margin:0; margin-bottom:1em;}
h1, h2 {margin:0; padding:0;}
#ajustadora {width:965px; margin:auto; min-height:100%; background-color:#FFFFFF; margin-bottom:-50px;}
#peu {height:50px; width:965px; margin-left:auto; margin-right:auto; clear:both;}
#peu span {position:relative; left:170px; top:10px;}
#cap {height:80px;}
#cap, #peu {background-color:#cc0000; color:#FFFFFF;}
/* cap i peu comparteixen els mateixos colors */
#logo, #titulo {height:100%;}
#logo {width:150px; float:left; margin-right:20px;}
#titulo { }
#titulo h1 {margin:0p; font-size:24px; position:relative; top:40px;}
#titulin {margin-bottom:20px;}
#titulin h2 {margin:0p; font-size:16px;}
#menu {clear:both; padding-top:8px; padding-bottom:8px; background-color:#333333; margin-bottom:20px;
padding-left:170px; }
#menu a {margin-right:20px;}
#menu a:link {color:#eaeaea;}
#menu a:visited {color:#eaeaea;}
#menu a:hover {color:#ffffff;}
#menu a:active {color:#ffffff;}
#submenu {/*width:150px;*/ width:120px; float:left; }
#submenu a {display:block; margin-bottom:10px; padding-left:30px; }
#submenu a:hover {background-image:url(triangle.png);
background-repeat:no-repeat; background-position:10px center; }
#submenu a:active {background-image:url(triangle.png);
background-repeat:no-repeat; background-position:12px center; }
#lateral {/*width:150px;*/ width:130px; padding-right:20px; float:right; }
#continguts {margin-left:170px; margin-right:170px; height:auto;}
#continguts p {margin-top:0; margin-bottom:20px; text-align:justify;}
#nomeflotes {clear:both; height:50px;}
I el resultat provisional és:
- Una evolució d'aquesta plantilla base la podeu trobar clicant aquí. Us convindria analitzar-la.
Vista la pàgina avia.html[Clica aquí] i mireu el codi seu codi font i a continuació el codi CSS. Us el podeu descarregar el CSS d'aquí.
* { /*margin:0; padding:0;*/
/* Aquí definim aspectes globals que no admetin herència i que els vulguem a qualsevol contenidor. */
}
html, body {height:100%; margin: 0px;
padding: 0px;}
/* aconseguim que body arribi de dalt a baix */
body {
/*background-color: #223300;*/
background-image:url(../img/fons_body.jpg);
background-position:left center;
background-color:#cddcdf;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
background-repeat: repeat-x;
background-attachment: fixed;
}
a {text-decoration:none;}
a:link {color:#333333;}
a:visited {color:#333333;}
a:hover {color:#cc0000;}
a:active{color:#ff3300;}
p {margin:0; margin-bottom:1em;}
h1, h2, h3, h4, h5 {margin:0; padding:0;}
#ajustadora {
min-height:100%;
background-color:#FFFFFF;
margin-bottom:-50px;
background-attachment: fixed;
background-image: url(../img/fons_ajustadora.jpg);
background-repeat: repeat-x;
background-position: center;
}
#ajustadora, #peu {width:1000px; margin-left:auto; margin-right:auto;}
#peu {height:50px; margin-left:auto; margin-right:auto; clear:both;}
#peu span {position:relative; left:150px; top:10px;}
#cap {height:80px;}
#cap, #peu {background-color:#cc0000; color:#000000;}
/* cap i peu comparteixen els mateixos colors */
#logo, #titulo {height:100%;}
#logo {width:150px; float:left; }
#titulo {}
#dia {float:right; position:relative;top:10px; right:20px; text-align:right;}
#titulo h1 {margin:0; font-size:14px; color:#000000; position:relative; top:7px; left:8px; font-weight:bold; font-variant:small-caps; color:#000000;}
#titulo img {position:relative; top:8px; }
#menu {clear:both; padding-top:8px; padding-bottom:8px; background-color:#333333; margin-bottom:20px;
padding-left:150px; }
#menu a {margin-right:10px;}
#menu a:link {color:#eaeaea;}
#menu a:visited {color:#eaeaea;}
#menu a:hover {color:#ffffff;}
#menu a:active {color:#ffffff;}
#lateral {/*width:150px;*/
width:130px;
padding-right:20px;
float:right;
color: #cc0000;
font-size: 10px;
}
#lateral h5 {font-size:14px; text-align:center; padding:1px; color:#FFFFFF; margin-bottom:10px; font-variant:small-caps;}
#lateral .anunci {margin-bottom:10px;padding-bottom:10px; /*border-bottom:1px solid #cccccc;*/ background-image:url(../img/bora_inf.gif); background-position:bottom; background-repeat:repeat-x;}
.fnegre {background-color:#000000; color:#FFFFFF;}
.fvermell {background-color:#cc0000; color:#FFFFFF;}
#lateral-2 {width:230px; margin-right:20px; float:right; font-size:11px; color:#666666;}
#lateral-2 img {margin-bottom:2px; width:100%;}
#lateral-2 h3 { font-size:12px; padding:4px; background-color:#cc0000; color:#eeeeee; text-align:center; margin-bottom:10px; font-variant:small-caps;}
#lateral-2 h4 { font-size:12px; margin-bottom:.2em; display:inline;}
#lateral-2 .notialt {margin-bottom:20px;}
#lateral-2 .notialt a {color:#cc0000; }
#titulin {margin-bottom:20px;}
#titulin h2 {margin:0p; font-size:22px; text-align:justify; }
#miguitas {font-size:10px;}
#miguitas a {color:#CC0000;}
#data {font-size:10px; float:right; font-weight:bold; color:#cc0000;}
#submenu {/*width:150px;*/ width:120px; float:left; }
#submenu a {display:block; margin-bottom:3px; padding:4px; padding-top:2; padding-left:30px; padding-bottom:2px; width:110px; font-weight:bold; color:#666666; position:relative; top:-2px; letter-spacing:-1px; font-size:11px;
/* li posem farcit esquerre(marge intern per la esquerra)
per deixar espai per col·locar la imatge de fons del triangle als
estats hover i active dels enllaços */
}
#submenu a:hover {background-image:url(../img/submenuhover.gif); color:#FFFFFF; background-color:#cc0000; }
#submenu a:active { background-color:#cc0000; color:#FFFFFF;}
#submenu a:focus { background-color:#cc0000; color:#FFFFFF;}
#continguts {margin-left:150px; /*margin-right:170px;*/ margin-right:425px; height:auto; color:#333333;}
#continguts p {margin-top:0; margin-bottom:20px; text-align:justify;}
#nomeflotes {clear:both; height:50px;}
.notialt a:target {content: "hola";}
- Si ja heu acabat d'arreglar el vostre prototipus podríeu convertir-lo en una plantilla seguint el tutorial pautat següent: [Clica aquí] Una altra possibilitat és la de continuar afegint funcionalitats de javascript al prototipus, com per exemple afegir els comportaments de DW, que són una col·lecció de Javascripts que venen amb DW. Podríeu posar per exemple menús emergents. [Clica aquí per veure tutorial pautat per posar menús emergents que es troba a la secció d'autoedició]