473,322 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Why I get a top margin. Going crazy here. Need some help, please.

Hello,

I am creating a centered web site with various div's inside the main
(pBase) div.

Somehow, I am getting a gap on the top of my browser window both in IE
and Firefox.

I tried everything I could think of. Here is my entire HTML code:

<!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>
<title>Test</title>
</head>
<body style="text-align: center">
<div id="pBase" style="clear:both; margin: 0px auto; text-align:left;
width:960px">
<div id="pHeader">pHeader</div>
<div id="pContent">
<div style="clear:both"></div>
<div id="pLogo" style="float:left;width:107px;">Logo</div>
<div id="pMenu" style="float:left;width:600px;">Menu</div>
<div style="clear:both"></div>
<div id="pWhatsUp" style="float:left;width:647px;">WhatsUp</div>
<div id="pLogin" style="float:left;width:100px;">Login</div>
<div style="clear:both"></div>
<div id="pLeft" style="float:left;width:100px;">Left</div>
<div id="pCenter" style="float:left;width:100px;">Center</div>
<div id="pRight" style="float:left;width:100px;">Right</div>
<div style="clear:both"></div>
</div>
<div id="pFooter">pFooter</div>
</div>
</body>
</html>

Could someone please help me out? I don't know what else to try!

Thanks,
Miguel

Dec 28 '06 #1
11 2434
In article
<11**********************@79g2000cws.googlegroups. com>,
"shapper" <md*****@gmail.comwrote:
Hello,

I am creating a centered web site with various div's inside the main
(pBase) div.

Somehow, I am getting a gap on the top of my browser window both in IE
and Firefox.

I tried everything I could think of. Here is my entire HTML code:
Could someone please help me out? I don't know what else to try!
I cannot make head nor tail of what you are doing really? But if
you want to be rid of gaps at the top try

<body style="margin:0;padding:0;>

at least...

You id things but there is no css sheet... Perhaps post a url.

--
dorayme
Dec 28 '06 #2
Hi,

I am not using CSS because I added all CSS styles in HTML code.
I tried your suggestion. I keep having the gap on the top.

Any idea?

Thanks,
Miguel
dorayme wrote:
In article
<11**********************@79g2000cws.googlegroups. com>,
"shapper" <md*****@gmail.comwrote:
Hello,

I am creating a centered web site with various div's inside the main
(pBase) div.

Somehow, I am getting a gap on the top of my browser window both in IE
and Firefox.

I tried everything I could think of. Here is my entire HTML code:
Could someone please help me out? I don't know what else to try!

I cannot make head nor tail of what you are doing really? But if
you want to be rid of gaps at the top try

<body style="margin:0;padding:0;>

at least...

You id things but there is no css sheet... Perhaps post a url.

--
dorayme
Dec 28 '06 #3
In fact it does work. I needed to clear the browser cache.

One question I have is:
Should I use a container around divs which float left?

I always get different answers or opinions.

I am a little bit lost about it since it is working in Firefox 2.0 and
IE 6.0 without the container.

Thanks,
Miguel
shapper wrote:
Hi,

I am not using CSS because I added all CSS styles in HTML code.
I tried your suggestion. I keep having the gap on the top.

Any idea?

Thanks,
Miguel
dorayme wrote:
In article
<11**********************@79g2000cws.googlegroups. com>,
"shapper" <md*****@gmail.comwrote:
Hello,
>
I am creating a centered web site with various div's inside the main
(pBase) div.
>
Somehow, I am getting a gap on the top of my browser window both in IE
and Firefox.
>
I tried everything I could think of. Here is my entire HTML code:
>
Could someone please help me out? I don't know what else to try!
>
I cannot make head nor tail of what you are doing really? But if
you want to be rid of gaps at the top try

<body style="margin:0;padding:0;>

at least...

You id things but there is no css sheet... Perhaps post a url.

--
dorayme
Dec 28 '06 #4
In article
<11*********************@79g2000cws.googlegroups.c om>,
"shapper" <md*****@gmail.comwrote:
I cannot make head nor tail of what you are doing really? But if
you want to be rid of gaps at the top try
>
<body style="margin:0;padding:0;>
>
at least...
>
You id things but there is no css sheet... Perhaps post a url.
>
--
dorayme
In fact it does work. I needed to clear the browser cache.

One question I have is:
Should I use a container around divs which float left?

I always get different answers or opinions.

I am a little bit lost about it since it is working in Firefox 2.0 and
IE 6.0 without the container.

First, please do not top post (fixed slapdashedly by me here...).

Your code snippet does not, of itself, exactly show what you are
wanting to do, it produces a few words here and there. Please
provide a URL and some good description of what you are meaning
to do to help out.

What is this business of fixing some item 960px to the right?
What about those with smaller screens.

Frankly, scrap the lot and look at some template you like and go
from there.

--
dorayme
Dec 28 '06 #5
Hi,

I will try to explain it better:

I am trying to create a centered web site with 3 main sections:
header, content and footer.

HEADER
CONTENT
FOOTER

All these sections should be 960px width.

Inside content section/div there will be various sections/divs using
the following layout:

Here is a drawing of the design inside CONTENT:

LOGO (width=107px) MENU (width=600px)

WHATSUP (width=647px) INSIDE
(width=100px)

LEFT (width=100px) CENTER (width=100px) RIGHT
(width=100px)

Basically that's it.

The words I added to my code is to identify where each div is going.

Could you give me some feedback about my code?

Thanks,
Miguel

dorayme wrote:
In article
<11*********************@79g2000cws.googlegroups.c om>,
"shapper" <md*****@gmail.comwrote:
I cannot make head nor tail of what you are doing really? But if
you want to be rid of gaps at the top try

<body style="margin:0;padding:0;>

at least...

You id things but there is no css sheet... Perhaps post a url.

--
dorayme
In fact it does work. I needed to clear the browser cache.

One question I have is:
Should I use a container around divs which float left?

I always get different answers or opinions.

I am a little bit lost about it since it is working in Firefox 2.0 and
IE 6.0 without the container.


First, please do not top post (fixed slapdashedly by me here...).

Your code snippet does not, of itself, exactly show what you are
wanting to do, it produces a few words here and there. Please
provide a URL and some good description of what you are meaning
to do to help out.

What is this business of fixing some item 960px to the right?
What about those with smaller screens.

Frankly, scrap the lot and look at some template you like and go
from there.

--
dorayme
Dec 28 '06 #6
shapper wrote:
Hi,

I am not using CSS because I added all CSS styles in HTML code.
I tried your suggestion. I keep having the gap on the top.
It works for me, with your code. Add this in the <headsection:

<style type="text/css">
body { margin: 0; padding: 0; }
</style>

Why is your new document using a Transitional doctype? That's for ..
well .. transitioning old documents. You should use Strict.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Please don't top-post. Thanks.

--
-bts
-Motorcycles defy gravity; cars just suck
Dec 28 '06 #7
Sorry,

but what do you mean with top-post?

Thanks,
Miguel

Beauregard T. Shagnasty wrote:
shapper wrote:
Hi,

I am not using CSS because I added all CSS styles in HTML code.
I tried your suggestion. I keep having the gap on the top.

It works for me, with your code. Add this in the <headsection:

<style type="text/css">
body { margin: 0; padding: 0; }
</style>

Why is your new document using a Transitional doctype? That's for ..
well .. transitioning old documents. You should use Strict.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Please don't top-post. Thanks.

--
-bts
-Motorcycles defy gravity; cars just suck
Dec 28 '06 #8
In article
<11**********************@79g2000cws.googlegroups. com>,
"shapper" <md*****@gmail.comwrote:
I am trying to create a centered web site with 3 main sections:
header, content and footer.

HEADER
CONTENT
FOOTER

All these sections should be 960px width.
You continue to top post, please don't as it makes it harder for
many people here on their newsreaders.

You don't address my warning and question about the 960px. we
need to get this straight before plunging into actual mark up. It
is an important overall question.

--
dorayme
Dec 28 '06 #9
In article
<11**********************@h40g2000cwb.googlegroups .com>,
"shapper" <md*****@gmail.comwrote:
Sorry,

but what do you mean with top-post?

Thanks,
Miguel

Beauregard T. Shagnasty wrote:

Ah! OK, fair enough...

Top posting is posting your reply before quoting what you are
replying to.

(btw, as they say, Google is your friend, try "top posting", this
one is not too bad:

<http://en.wikipedia.org/wiki/Top-posting>

and discusses some issues)

--
dorayme
Dec 28 '06 #10

dorayme wrote:
In article
<11**********************@h40g2000cwb.googlegroups .com>,
"shapper" <md*****@gmail.comwrote:
Sorry,

but what do you mean with top-post?

Thanks,
Miguel

Beauregard T. Shagnasty wrote:


Ah! OK, fair enough...

Top posting is posting your reply before quoting what you are
replying to.
Ok, thanks for the info.
Let's see If I am getting this right. :-)

Thanks once again,
Miguel
>
(btw, as they say, Google is your friend, try "top posting", this
one is not too bad:

<http://en.wikipedia.org/wiki/Top-posting>

and discusses some issues)

--
dorayme
Dec 28 '06 #11
In article
<11**********************@79g2000cws.googlegroups. com>,
"shapper" <md*****@gmail.comwrote:
>what do you mean with top-post?

Ah! OK, fair enough...

Top posting is posting your reply before quoting what you are
replying to.

Ok, thanks for the info.
Let's see If I am getting this right. :-)
Actually, you are doing even better now, answering in context, a
variation on bottom posting :-)

(btw,
--
dorayme
Dec 28 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard | last post by:
I need help. I have a smarty based program that I am modifying. I have a smarty template file that consists of smarty and HTML. I need to integrate some PHP database calls into it. My problem...
1
by: trialanderror | last post by:
I've been happily chugging along thinking I understood floating divs and now find that I know a lot less than I thought I did. And the more I try "fixing" things, the worse it gets. A lot of what...
5
by: spoilsport | last post by:
Ive got to write a multi-function program and I'm plugging in the functions but I keep getting this error from line 40. Im new to this and cant find an answer anywhere. Sam #include...
0
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use...
5
by: Newbie! | last post by:
Hi Group, Im trying to Format some coloums on my Datagrid so that only 3 Coloums are show out of the 20 in my Dataset, I just carn`t for the life of me get it to work, i`ve looked everywhere for...
3
by: Luciano A. Ferrer | last post by:
this is really strange... I cant find what is wrong... so, #botonera have a left margin of 18px, but IE make it 36px! If I put a margin of 30px, IE make it 60px! I am crazy? <!DOCTYPE html...
1
by: cbradio | last post by:
thescripts gurus, I would like to know if I could get some help with making elements of my layout expand (liquid) to the size of their containers, but also allow for some predefined, static...
5
by: Neviton | last post by:
Hi this is the html to generate the behavior: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
5
by: David Schwartz | last post by:
I've got a sidebar element that's a floating div. To the left of this div, there are p's each with a margin-right set as well as overflow: auto set (see below)). Some of the p's are of class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.