eXceem

Go Back   eXceem > Off Topic > Technical Help

Claim your amazing £1,000 slots booster bonus now!


Small CSS issue

This is a discussion on Small CSS issue within the Technical Help forums, part of the Off Topic category; I'm making a site and the header doesn't show right , it doesn't seem to stick to the top. It's ...

Reply
 
Thread Tools
Old 21-11-08, 11:12 PM   #1
1 new message
 
omairt's Avatar
 
Join Date: Jul 2007
Location: Omicron Persei 8
Posts: 2,518
omairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud of

Small CSS issue


I'm making a site and the header doesn't show right , it doesn't seem to stick to the top. It's appears to be 8px below the top in Firefox and 15px in IE.

This is what's happening, but I want the that red rectangle to stick to the top.

These are the CSS properties:
Code:
body {
background:#e6f3ff url(http://www.exceem.co.uk/forums/images/bg.gif) repeat-x;
color:#102840;
text-align:center;
}

#header {
background: #ff0000;
width: 800px;
height: 300px;
position: top center;
margin: auto;
padding: 0;
}
Would appreciate any help.

Thanks,
Omair.
 
Reply With Quote
Old 22-11-08, 12:48 AM   #2
Mini Mac
 
Join Date: Feb 2008
Posts: 3,135
-null- is a glorious beacon of light-null- is a glorious beacon of light-null- is a glorious beacon of light
Code:
#header {
background: #ff0000;
width: 800px;
height: 300px;
position: top center;
margin: auto;
margin-top: 0;
padding: 0;
}
 
Reply With Quote
Old 22-11-08, 12:53 AM   #3
1 new message
 
omairt's Avatar
 
Join Date: Jul 2007
Location: Omicron Persei 8
Posts: 2,518
omairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud of
Still not working
 
Reply With Quote
Old 22-11-08, 01:02 AM   #4
Mini Mac
 
Ilikefree's Avatar
 
Join Date: Jul 2008
Location: London
Posts: 5,087
Ilikefree is a name known to allIlikefree is a name known to allIlikefree is a name known to allIlikefree is a name known to all
i barely know css so i doubt this will help:
Code:
#header {
background: #ff0000;
width: 800px;
height: 300px;
position: top center;
margin-top: 0;
padding: 0;
}
__________________
Help an old friend wrap up his freebie-ing by signing up for me in a trade on either Apple FJ or PS3 Kudos! £15 per green!
(pm me and I'll set it up in the trade centre)
 
Reply With Quote
Old 22-11-08, 01:04 AM   #5
1 new message
 
omairt's Avatar
 
Join Date: Jul 2007
Location: Omicron Persei 8
Posts: 2,518
omairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud of
Quote:
Originally Posted by Ilikefree View Post
i barely know css so i doubt this will help:
Code:
#header {
background: #ff0000;
width: 800px;
height: 300px;
position: top center;
margin-top: 0;
padding: 0;
}
Nope, didn't work, it just moved it to the left. I think I need the margin: auto to keep it centred, which means that my position bit may be wrong.
 
Reply With Quote
Old 22-11-08, 01:15 AM   #6
Mini Mac
 
beezer123's Avatar
 
Join Date: Dec 2006
Location: Aberdeenshire
Posts: 4,038
beezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud of
Send a message via MSN to beezer123
Set the margin to -15px, that'll bring it up to the top in ie and firefox I think

Quote:
body {
background:#e6f3ff url(http://www.exceem.co.uk/forums/images/bg.gif) repeat-x;
color:#102840;
text-align:center;
}

#header {
background: #ff0000;
width: 800px;
height: 300px;
margin:auto;
margin-top: -15px;
padding: 0;
}
Hopefully that should work for you
__________________
My Sites

Free Nintendo DSi
Free Macbook Pro
Free Galaxy Nexus
Free iPhone 4S
Free iPad 2


open spoiler to see what im doing
Spoiler

Last edited by beezer123; 22-11-08 at 01:20 AM..
 
Reply With Quote
Old 22-11-08, 01:18 AM   #7
Free The Gadgets
 
corky20's Avatar
 
Join Date: Jan 2007
Location: NI
Posts: 4,776
corky20 is a splendid one to beholdcorky20 is a splendid one to beholdcorky20 is a splendid one to beholdcorky20 is a splendid one to beholdcorky20 is a splendid one to behold
Send a message via twitter to corky20
Don't really know CSS but try...

#header {
position: static;
background: #ff0000;
width: 800px;
height: 300px;
position: top center;
margin: auto;
margin-top: 0;
padding: 0;
}

or

#header {
display: inline;
background: #ff0000;
width: 800px;
height: 300px;
position: top center;
margin: auto;
margin-top: 0;
padding: 0;
}
 
Reply With Quote
Old 22-11-08, 01:25 AM   #8
1 new message
 
omairt's Avatar
 
Join Date: Jul 2007
Location: Omicron Persei 8
Posts: 2,518
omairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud of
Quote:
Originally Posted by beezer123 View Post
Set the margin to -15px, that'll bring it up to the top in ie and firefox I think

Hopefully that should work for you
Shows fine in IE but not in Firefox. It's 8px below in Firefox for me, so if I do -8px, it fixes it in Firefox, but then moves it in IE.

@corky20: position: static doesn't make a difference, and display: inline makes it disappear
 
Reply With Quote
Old 22-11-08, 01:27 AM   #9
Mini Mac
 
beezer123's Avatar
 
Join Date: Dec 2006
Location: Aberdeenshire
Posts: 4,038
beezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud ofbeezer123 has much to be proud of
Send a message via MSN to beezer123
argh I was close.
Have a look on here

css-tricks.com

It's extremely helpful to me and hopefully to anyone else.
__________________
My Sites

Free Nintendo DSi
Free Macbook Pro
Free Galaxy Nexus
Free iPhone 4S
Free iPad 2


open spoiler to see what im doing
Spoiler
 
Reply With Quote
Old 22-11-08, 01:58 AM   #10
1 new message
 
omairt's Avatar
 
Join Date: Jul 2007
Location: Omicron Persei 8
Posts: 2,518
omairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud ofomairt has much to be proud of
Finally!

I added margin:0 to the body. The header CSS was fine, it's the body that had default padding.
 
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off





All times are GMT. The time now is 09:37 AM.
All trademarks and copyrights held by respective owners. Forum posts are owned by the poster.

Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO
no new posts