Go Back   eXceem > Off Topic > Technical Help


Get a Free iPhone 3GS with Free3GiPhone.com


Reply
 
LinkBack 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,520
Thanks: 877
Thanked 988 Times in 699 Posts
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://cdn1.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.
__________________
Offline  
Reply With Quote
Old 22-11-08, 12:48 AM   #2
iBook
 
Join Date: Feb 2008
Posts: 2,556
Thanks: 702
Thanked 447 Times in 388 Posts
-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;
}
Online  
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,520
Thanks: 877
Thanked 988 Times in 699 Posts
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
__________________
Offline  
Reply With Quote
Old 22-11-08, 01:02 AM   #4
Mini Mac
 
Ilikefree's Avatar
 
Join Date: Jul 2008
Location: London
Posts: 4,380
Thanks: 1,430
Thanked 929 Times in 849 Posts
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
Send a message via twitter to Ilikefree
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;
}
__________________


One, 21 guns. Throw up your arms.
My Sites:
Football Forum
Free DSi | Free iPhone 3GS | Drake Bell | Cheap UK-Based Web Hosting
Total received: £201.61
Offline  
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,520
Thanks: 877
Thanked 988 Times in 699 Posts
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.
__________________
Offline  
Reply With Quote
Old 22-11-08, 01:15 AM   #6
Mini Mac
 
beezer123's Avatar
 
Join Date: Dec 2006
Location: Aberdeenshire
Posts: 3,625
Thanks: 1,276
Thanked 936 Times in 581 Posts
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://cdn1.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
__________________
Currently:



My Sites

Free Nintendo DSi
www.macbook4u.co.uk
Free Android
Free PS3 Games


open spoiler to see what im doing
Spoiler

Last edited by beezer123; 22-11-08 at 01:20 AM..
Offline  
Reply With Quote
Old 22-11-08, 01:18 AM   #7
Are YOU talkin' to me?
 
corky20's Avatar
 
Join Date: Jan 2007
Location: NI
Posts: 3,486
Thanks: 862
Thanked 862 Times in 605 Posts
corky20 is a name known to allcorky20 is a name known to allcorky20 is a name known to allcorky20 is a name known to all
Send a message via MSN 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;
}
__________________
Spoiler


Free iPhone l Free PS3 Slim l Free Xbox 360 l Free Final Fantasy 13
Online  
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,520
Thanks: 877
Thanked 988 Times in 699 Posts
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
__________________
Offline  
Reply With Quote
Old 22-11-08, 01:27 AM   #9
Mini Mac
 
beezer123's Avatar
 
Join Date: Dec 2006
Location: Aberdeenshire
Posts: 3,625
Thanks: 1,276
Thanked 936 Times in 581 Posts
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.
__________________
Currently:



My Sites

Free Nintendo DSi
www.macbook4u.co.uk
Free Android
Free PS3 Games


open spoiler to see what im doing
Spoiler
Offline  
Reply With Quote
The Following 2 Users Say Thank You to beezer123 For This Useful Post:
Ilikefree (22-11-08), omairt (22-11-08)
Old 22-11-08, 01:58 AM   #10
1 new message
 
omairt's Avatar
 
Join Date: Jul 2007
Location: Omicron Persei 8
Posts: 2,520
Thanks: 877
Thanked 988 Times in 699 Posts
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.
__________________
Offline  
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 On




All times are GMT. The time now is 06:42 PM.
All trademarks and copyrights held by respective owners. Forum posts are owned by the poster.

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