Prendo come esempio la pagina di html.it. Allora il topmargin è a "0" e anche sotto la pagina, ossia, sia sopra che sotto è a limite. Come si fa?
grazie.
Prendo come esempio la pagina di html.it. Allora il topmargin è a "0" e anche sotto la pagina, ossia, sia sopra che sotto è a limite. Come si fa?
grazie.
nel body (o anche in un css esterno), MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" LEFTMARGIN="0"
nel css basta scrivere
html{height:100%;}
body{margin:0px;height:100%;text-align:center;}
#box {height:100%;margin:auto;width:720px;border1px solid #000000;}
<html>
..
<body>
<div id="box">
</div>
</body>
</html>
ti crea un box centrale alto il 100% della pagina
occhio però che oltre all'esempio postato da antos, tocca mettere nel body anche
marginheight="0" marginwidth="0"
altrimenti NN4 attribuisce dello spazio.
Giusto per la cronaca (anche se nn4 sta andando lentamente a )
Scusate ragazzi, ma visto che sto iniziando, mi potete dire il codice completo e dove esatamente lo metto.
Grazie mille!
dal codice di antos
stile.css :
html{height:100%;}
body{margin:0;height:100%;text-align:center;}
#box {height:100%;margin:auto;width:720px;border1px solid #000000;}
pagina.htm:
<html>
<head>
<link rel="stylesheet" href="stile.css" type="text/css">
</head>
<body>
<div id="box">
</div>
</body>
</html>
Heaven's closed. Hell sold out.
Linux 2.6.26-2-amd64
Debian squeeze
in un file css esterno (soluzione consigliata):
così (e NN4 lascia un proprio spazio):
body { background-color: #FFFFFF; color: #000000; font-family: tuofont; margin: 0px }
oppure, se vuoi che anche NN4 faccia come gli altri browser, oltre al codice sopra devi mettere, nel body delle pagine, anche questo:
marginheight="0" marginwidth="0"
Posto il codice perche non riesco a capire dove sbaglio:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Prova</title>
</head>
<body bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<div align="center">
<table width="770" border="0" cellspacing="0" cellpadding="0" bgcolor="#f0e68c" cool gridx="16" gridy="16" height="800" showgridx showgridy usegridx usegridy>
<tr height="799">
<td width="769" height="799"><spacer type="block" width="769" height="799"></td>
<td width="1" height="799"><spacer type="block" width="1" height="799"></td>
</tr>
<tr height="1" cntrlrow>
<td width="769" height="1"><spacer type="block" width="769" height="1"></td>
td width="1" height="1"><spacer type="block" width="1" height="1"></td>
</tr>
</table>
</div>
</body>
</html>
grazie ancora!
Il problema e` che nel tu codice non colleghi (o importi) i css.
Tra <head> e </head> devi inserire
<link rel="stylesheet" type="text/css" href="tuo_file.css"> (per collegarlo)
oppure
<style type="text/css">
@import "tuo_file.css";
</style>
per importare il css.
Poi scegliere tu quale usare.
Spero di essere stato chiaro, ciao
se non lo includi ?Originariamente inviato da pariri
Posto il codice perche non riesco a capire dove sbaglio:
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Prova</title>
</head>
<body bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
<div align="center">
<table width="770" border="0" cellspacing="0" cellpadding="0" bgcolor="#f0e68c" cool gridx="16" gridy="16" height="800" showgridx showgridy usegridx usegridy>
<tr height="799">
<td width="769" height="799"><spacer type="block" width="769" height="799"></td>
<td width="1" height="799"><spacer type="block" width="1" height="799"></td>
</tr>
<tr height="1" cntrlrow>
<td width="769" height="1"><spacer type="block" width="769" height="1"></td>
td width="1" height="1"><spacer type="block" width="1" height="1"></td>
</tr>
</table>
</div>
</body>
</html>
grazie ancora!
cmq il codice css lo puoi inserire direttamente nella pagina dove vuoi che sia applicato :
tra <haed> e</head>
<style>
...
</style>