Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 2.0 / 3.5 / 4.0
Master page con header e footer
martedì 15 aprile 2008 - 09.18
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
volperubbia
Profilo
| Senior Member
375
messaggi | Data Invio:
mar 15 apr 2008 - 09:18
Ciao a tutti,
sto pensando ad uno schema di master page per il mio sito. Per comodità mi sono fatto prima una bozza html e una bozza aspx, che poi userò per il file .master.
Noto però già fra l'html e l'aspx un risultato differente, nella versione aspx infatti sembra non aver effetto l'height al 100% ...
Esempio html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<STYLE>
BODY {margin: 0px; font-family: Verdana, Helvetica, sans-serif; }
IMG {margin: 0px; border: 0px; vertical-align: middle }
A.Header {color: #FFFFFF; }
A.Header:active {text-decoration: none; color: #FFFFFF; }
A.Header:link {text-decoration: none; color: #FFFFFF; }
A.Header:visited {text-decoration: none; color: #FFFFFF; }
A.Header:hover {text-decoration: underline; }
TABLE.PageMain {width: 100%; height: 100%; border: 0; margin: 0; padding: 0; }
TR.PageMain {height: 100%; text-align: left; vertical-align: middle; }
TR.PageHeader {font-weight: bold; font-size: x-small; height: 1.4em; color: #ffffff; background-color: #005c6a; }
TR.PageFooter {font-weight: bold; font-size: x-small; height: 1.4em; color: #ffffff; background-color: #005c6a; text-align: center; }
TR.TitleHeader {background-color: #f2f2cd; font-weight: bold; font-size: large}
</STYLE>
</HEAD>
<BODY>
<TABLE CLASS="PageMain" cellspacing="0">
<TR CLASS="PageHeader">
<TD>Header</TD>
</TR>
<TR CLASS="TitleHeader">
<TD>Titolo</TD>
</TR>
<TR CLASS="PageHeader">
<TD>Menù</TD>
</TR>
<TR CLASS="PageMain">
<TD>Prova</TD>
</TR>
<TR CLASS="PageFooter">
<TD>Footer</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Esempio aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Prova.aspx.vb" Inherits="TLDataCollect.Prova" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head runat="server">
<STYLE>
BODY {margin: 0px; font-family: Verdana, Helvetica, sans-serif; }
IMG {margin: 0px; border: 0px; vertical-align: middle }
A.Header {color: #FFFFFF; }
A.Header:active {text-decoration: none; color: #FFFFFF; }
A.Header:link {text-decoration: none; color: #FFFFFF; }
A.Header:visited {text-decoration: none; color: #FFFFFF; }
A.Header:hover {text-decoration: underline; }
TABLE.PageMain {width: 100%; height: 100%; border: 0; margin: 0; padding: 0; }
TR.PageMain {height: 100%; text-align: left; vertical-align: middle; }
TR.PageHeader {font-weight: bold; font-size: x-small; height: 1.4em; color: #ffffff; background-color: #005c6a; }
TR.PageFooter {font-weight: bold; font-size: x-small; height: 1.4em; color: #ffffff; background-color: #005c6a; text-align: center; }
TR.TitleHeader {background-color: #f2f2cd; font-weight: bold; font-size: large}
</STYLE>
</head>
<body>
<form id="form1" runat="server">
<TABLE CLASS="PageMain" cellspacing="0">
<TR CLASS="PageHeader">
<TD>Header</TD>
</TR>
<TR CLASS="TitleHeader">
<TD>Titolo</TD>
</TR>
<TR CLASS="PageHeader">
<TD>Menù</TD>
</TR>
<TR CLASS="PageMain">
<TD>Prova</TD>
</TR>
<TR CLASS="PageFooter">
<TD>Footer</TD>
</TR>
</TABLE>
</form>
</body>
</html>
Probabilmente manca qualcosa nello stile ... ma non sono riuscito a capire cosa. Ho anche notato che se imposto l'altezza dello stile TR.PageMain in pixel, funziona. E' la % che da problemi ...
Qualche idea?
Davide
amelix
Profilo
| Expert
694
messaggi | Data Invio:
mar 15 apr 2008 - 09:25
Prova a togliere le definizioni XML da:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
A.
Andrea -
http://www.MelisWeb.eu/
CMS -
http://www.WebOrama.it/
volperubbia
Profilo
| Senior Member
375
messaggi | Data Invio:
mar 15 apr 2008 - 13:04
Perfetto!
amelix
Profilo
| Expert
694
messaggi | Data Invio:
mar 15 apr 2008 - 13:36
Cmq non è standard...
A.
Andrea -
http://www.MelisWeb.eu/
CMS -
http://www.WebOrama.it/
volperubbia
Profilo
| Senior Member
375
messaggi | Data Invio:
sab 3 mag 2008 - 11:24
Già ... ho notato anche io che togliere le definizioni XML dall'intestazione non è standard, infatti mi dà problemi con i popup di ajax. Per posizionare un footer in fondo alla pagina mi dovrò inventare altro.
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !