Tuesday, March 30, 2010

Removing space at top of page/table

Hi, I've spent a couple hours googling and searching for the solution to remove the empty space at the top of the page. This is the first website I am making using CS4 so I am not an advanced user. Amongst other things, I have tried inserting: body { margin: 0; padding:0; } but have had no success. In Firefox, there is a big gap at the top, while in IE there is no gap.

In addition to attaching the file, here is the 1st part of the script in which I think the problem lies:

%26lt;head%26gt;
%26lt;meta http-equiv=''Content-Type'' content=''text/html; charset=utf-8'' /%26gt;
%26lt;title%26gt;Inicio%26lt;/title%26gt;
%26lt;style type=''text/css''%26gt;
%26lt;!--
.Georgia {
?font-family: Georgia, ''Times New Roman'', Times, serif;
?color: #000;
?text-align: center;
}
body,td,th {
?font-size: large;
?color: #000;
?text-align: center;
}
.Heading2 {
?font-size: 24px;
}
body {
?background-color: #000;
?margin-top: 0px;
?margin-bottom: 0px;
}
a:link {
?color: #FFF;
?text-decoration: none;
}
a:visited {
?text-decoration: none;
?color: #FFF;
}
a:hover {
?text-decoration: underline;
?color: #00F;
}
a:active {
?text-decoration: none;
?color: #00F;
}
#form1 table tr td label {
?font-weight: bold;
}
#form1 table tr td {
?font-weight: bold;
?font-size: 16px;
}
--%26gt;

%26lt;/style%26gt;
%26lt;/head%26gt;

%26lt;body%26gt;

%26lt;TABLE cellSpacing=0 cellPadding=5 align=center bgcolor=''#CCF''%26gt;
?%26lt;TBODY%26gt;
%26lt;TR%26gt;
%26lt;TD height=''689'' valign=''top'' style=''BORDER-RIGHT: black 50px solid; BORDER-TOP: black 0px solid; BORDER-LEFT: black 50px solid; BORDER-BOTTOM: black 0px solid; text-align: center; font-size: 30px; font-weight: bold;''%26gt;%26lt;h1 class=''Georgia''%26gt;%26lt;a href=''Inicio.html''%26gt;
%26lt;div align=''top''%26gt;%26lt;img src=''InversionGarantizada Banner.PNG'' alt=''Banner'' width=''728'' height=''90'' hspace=''0'' vspace=''0'' align=''top'' /%26gt;%26lt;/div%26gt;%26lt;/a%26gt;%26lt;/h1%26gt;

Removing space at top of page/table

You can go to Window | Properties, select page properties, set the top margin to 0, which will produce this css rule

body {

margin-top:0px;

}

Gary

Removing space at top of page/table

Ok, I just looked a little further, first thing you should do is run this page thru the validator...

http://validator.w3.org/

And fix your issues. I believe this issue is stemming from the %26lt;h1%26gt; tag as it seems to be overlapping two different elements, plus you have not set any rules for it

h1 {

margin:0px;

}

Run the validator first..

Gary

did you try:

body, html {margin:0px; padding:0px }

?

thank you gary, adding the following rule into the code did the job. I would have never known how to solve this problem otherwise.

h1 {

margin:0px;

}

Glad I could help.

Gary

No comments:

Post a Comment