HighDots Forums  

I can't get div to align to top of page

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss I can't get div to align to top of page in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
edgy
 
Posts: n/a

Default I can't get div to align to top of page - 03-17-2009 , 04:03 PM






Hi,

I've set all the margins and paddings to 0 that I can think of, but I
can't seem to remove what seems to be about 20px of space above my
container div. Can anyone spot it?

http://www.mankar.ca/test.php

thanks!

Reply With Quote
  #2  
Old   
dorayme
 
Posts: n/a

Default Re: I can't get div to align to top of page - 03-17-2009 , 04:16 PM






In article <pan.2009.03.17.20.03.16.962304 (AT) notmail (DOT) com>,
edgy <hotmail (AT) notmail (DOT) com> wrote:

Quote:
http://www.mankar.ca/test.php
er...

<div id="hdr" style="margin: -18px">

Only kidding though it "works" maybe!

Seriously, try:

changing your

h3 { color:#9F6600;}

to

h3 { color:#9F6600; margin: 0;}

--
dorayme


Reply With Quote
  #3  
Old   
edgy
 
Posts: n/a

Default Re: I can't get div to align to top of page - 03-17-2009 , 04:30 PM



On Wed, 18 Mar 2009 07:16:08 +1100, dorayme wrote:

Quote:
try:
changing your
h3 { color:#9F6600;}
to
h3 { color:#9F6600; margin: 0;}
Thanks, that works! And giving it some padding-top doesn't pull down the
background image.





Reply With Quote
  #4  
Old   
edgy
 
Posts: n/a

Default Re: I can't get div to align to top of page - 03-17-2009 , 05:01 PM



On Tue, 17 Mar 2009 16:33:03 -0400, Beauregard T. Shagnasty wrote:

Quote:
dorayme wrote:

edgy <hotmail (AT) notmail (DOT) com> wrote:
http://www.mankar.ca/test.php

Seriously, try: changing your

h3 { color:#9F6600;}
to
h3 { color:#9F6600; margin: 0;}

Begs the question, where is the <h1> [and the <h2>]?

It appears edgy is using the header elements just for font sizing,
rather than their intended semantic markup purpose.

h3 class="inverse">Mankar Ontario Inc.</h3
should be a <div>. Then, I would use the "Chemical weed control ..."
line as the <h1>, with the following headers as <h2>s.
You caught me. This was pointed out to me previously and I pushed it to
the bottom of the pile. My mindset was "well, when I do a major rewrite
I'll fix all that stuff up". I guess now's the time.

Thanks for reminding me.



Reply With Quote
  #5  
Old   
dorayme
 
Posts: n/a

Default Re: I can't get div to align to top of page - 03-17-2009 , 05:33 PM



In article <gpp1dv$c82$1 (AT) news (DOT) motzarella.org>,
"Beauregard T. Shagnasty" <a.nony.mous (AT) example (DOT) invalid> wrote:

Quote:
dorayme wrote:

edgy <hotmail (AT) notmail (DOT) com> wrote:
http://www.mankar.ca/test.php

Seriously, try: changing your

h3 { color:#9F6600;}
to
h3 { color:#9F6600; margin: 0;}

Begs the question, where is the <h1> [and the <h2>]?
You are not wrong!

I was in a question begging mood. I thought to practice a short sharp
post rather than the ones I prefer: long, rambling, infuriating ones. <g>

--
dorayme


Reply With Quote
  #6  
Old   
Swifty
 
Posts: n/a

Default Re: I can't get div to align to top of page - 03-18-2009 , 12:42 AM



edgy wrote:
Quote:
I've set all the margins and paddings to 0 that I can think of, but I
can't seem to remove what seems to be about 20px of space above my
container div. Can anyone spot it?

http://www.mankar.ca/test.php
You have your answer, but having been in a similar situation myself
several times recently, I would recommend using FireFox with FireBug or
Opera with DragonFly for your debugging sessions.

Both browsers allow you to select items from your source, and to have
the debugger show every conceivable dimension of the object (margins,
padding, etc) so it is fairly simple to see why you are getting a "gap"
that you don't want, and then to eliminate it.

A little harder is understanding why you *don't* always get the gap that
you did want. I suspect this is because margins can overlap, or even
disappear in some circumstances, but that's something I plan to learn
some other day. I've already learned my "one new thing" for today, and
don't want to overdo things.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.