Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How best to position a div tag inside the header bar ?
Old 12-31-2008, 09:45 AM How best to position a div tag inside the header bar ?
Experienced Talker

Posts: 30
Trades: 0
Hi


I need to position the <Div id="king"> within my header ?


I know I should know how to do this, but I'm struggling.


<div id="wrapper2">
<div id="header">
<div id="navigation">
<div id="kings"><img src="kingsofleon.jpg" alt="itunes" width="248" height="140" border="0" /></div>
</div>
I need the "king" div to sit right of center. Currently I have:
#navigation
{
clear: both;
width: 100%;
background: #ffffff url('images/navheader1.jpg') no-repeat top;
height: 230px;
}
#kings {
position:absolute;
width:261px;
height:144px;
z-index:1;
text-align:center;
top:29px;
}
If I add left:740px; it sits where I want it but only on the 1268 res screen.


Basically I need to position it inside the header tag rather than on the screen, but if I use say left: it does it from the far left of the screen?


Ashley

Last edited by acknowledged74; 12-31-2008 at 02:29 PM..
acknowledged74 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-31-2008, 11:32 AM Re: How best to position a div tag inside the header bar ?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
The first thing you need to do is get rid of that position:absolute, it's not necessary.

Set position:relative on #wrapper2.

Your #header is set to a zero height - how do you expect anything to fit inside of zero ? It's also not necessary to float #header since it fills the entire width of #wrapper2.

You have no dimension on #kings. If you float an element, it MUST have a defined width. I would just float #kings left and give it a left margin to push it over where you want it.

In addition, #wrapper is not containing anything and neither is #header because your floats are not properly cleared.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-31-2008, 12:17 PM Re: How best to position a div tag inside the header bar ?
Experienced Talker

Posts: 30
Trades: 0
thanks

Ok I've got rid of #header because frankly I only put it in to try and sort out this issue.

The #kings does have dimensions i.e. width:261px; height:144px; I made sure of that so I could float it.

Anyway changing the positive to relative, and getting rid of the header tags has help though now I have a big gap ?

ARGGHGHHGH
acknowledged74 is offline
Reply With Quote
View Public Profile
 
Old 12-31-2008, 12:18 PM Re: How best to position a div tag inside the header bar ?
Experienced Talker

Posts: 30
Trades: 0
Actually now the navigation has disppeared all together in IE7 ?
acknowledged74 is offline
Reply With Quote
View Public Profile
 
Old 12-31-2008, 05:29 PM Re: How best to position a div tag inside the header bar ?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You'll have to re-post the link to the site so we can see it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How best to position a div tag inside the header bar ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15398 seconds with 12 queries