472,374 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 2364
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.