views:

169

answers:

3

Hi,

I have a logo image across the entire top of my wesit page. The logo itself only takes up about one third of the left hand side. The right two thirds of this bar is plain and dark blue in color. I have several links and the user name displayed on the right side and would like to float those over the image.

Originally, I had the image taking up the left two thirds of the bar (div) and a seperate div with my links on the right. The problem is that that method leaves a noticeable boundary line between the two divs even though they are the same color.

Is transparency going to help? How do I set this up?

Thank you, James

_________________________________________________________________
|  LOGO HERE                              User: David Troy      |
|  LOGO HERE                          Home | FAQ | Contact Us   |
|_______________________________________________________________|
A: 

try :

div.left, div.right {
  margin : 0px;
  padding : 0px;
}

Assuming your left div has a class="left" and the right one has a class="right"

That will remove the spacing between the divs.

Paul Tarjan
Hi Paul, no difference between this and what I had before. Now, between you and I, this is just fine. I need a magnifying glass to see the boundary between the two divs. The client I am doing this for is kind of NUTS about things being PERFECT (in his eyes) and he doesn't like this. So to humor him, I am tring to use a full length image and float the links and user name on top of the image div. Is there any way to do that? Thanks and please realize this isn't me that is being so.... Well not sure what the term would be!
James
Note, I have to get like 6 inches from the sccreen to see any boundary! Totally absurd in my opinion.
James
A: 

I'm somewhat confused as to what you're trying to accomplish.

If you're using float, then make sure that you're specifying a width to each div.

If you just want the text to be on top of the image, two simple div blocks should work.

<div>
Your links here
</div>
<div>
<img src="yourimg.gif" />
</div>

If you want them to be side by side, this should work:

<div style="float: left; width: 400px">
<img src="yourimg.gif" />
</div>
<div style="float: left; width: 400px">
Link 1
Username
</div>
Baddie
I don't want them side by side because there seems to be a VERY TINY hairline showing between the divs. You have to be right up to the screen to see this. So I want the image div to be 100% width and put my link controls on top (transparent background I guess).
James
Do I just put the transparent div inside the other? Will try that...
James
A simple 2 div setup should work perfectly. Try this:<div>Put your links here</div><div><img src="yourimg.gif" /></div>
Baddie
Try the first piece of code I put in the answer. How are your links organized? Just <a href="... one after the other?
Baddie
I am sorry, when I said "On top" I didn't mean vertically on a flat plain, I meant so the links are covering the same div the image is in (the links would be on the far right side which is all plain dark blue in color. The image is a bar the full screen width but the actual image (other than the dark background) is to the far left. So I want my white links to be in the same div as the image bar, but "on top" of the image.
James
Have you tried going back to your original design and messing with the width of the two divs? "The image is a bar" and "actual image"...? I'm very confused. Got some images we take a look at?
Baddie
Here is a simple view, the entire bar is an image in dark blue with large logo letters on the far left. The user name and links on the right I want a transparent background so the underlying blue image shows:_________________________________________________________| LOGO HERE user: David Troy || LOGO HERE Home | FAQ | Contact Us ||________________________________________________________
James
Well, that didn't render well (supposed to be three lines there. I will see about an image. Thanks
James
I think I have made this more complicated than it is. My image is a background image so I think I can put whatever I want "On top" of it my just putting my controls in that same div as the background image. I will try it out, Sorry for my confusion!
James
Lol yeah. So I assume you have two images, the logo and the background image? Is the background image just blue?
Baddie
Nope, one image that is mostly just blue with the logo on the left.
James
+1  A: 

Concerning the "hairline space": if you are using Internet Explorer, you will have to omit spaces between the divs as follows:

<div class="left">Logo</div><div class="right">Links</div>

This is due to Quirks mode, I believe; it displays as expected in XHTML Strict mode.

Then, the CSS looks like this:

div.left {
  float : left;
}
div.left, div.right {
  margin : 0px;
  padding : 0px;
}
Paul Lammertsma