[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 891
  • Last Modified:

Need help floating div over image

I am trying to float the top grey menu on this page over the blue header graphic. I have the topmenu div set to float right but it only will display above or below the header graphic. any ideas?

http://tampabobby.com/landing/locations.html

thanks,
bobby
0
ob1_
Asked:
ob1_
  • 4
  • 3
  • 3
2 Solutions
 
EnclavetCommented:
Floating a div will only do what it says "float" meaning if there is empty space on the right it will move to the right.

There are several ways you can handle this.

You can set the div to position absolutely over the image:

<div style="position: absolute; left: 20px; top: 160px;">

Play with the left and top until the div is exactly where you want it. Only problem with this is with issues of resizing the page or when you use different browsers, it might be displayed differently from what you want it to look like.

You can also use another position setting called relative.

Try setting the div menu that is floated right to:
position: relative;
left: 20px

This will move the menu that is floated right 20px to the left and over the graphic.
0
 
ob1_Author Commented:
how about this: http://tampabobby.com/landing/locations.html
does this look right or do you think i should incorporate the grey menu into the header area?
0
 
ob1_Author Commented:
i tried position: relative, left 20px but it still displays @ top or bottom. i don't think absolute positioning would be good. let me know if you have any other ideas.
 
 
 
thanks,
bobby
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
s8webCommented:
Try negative margin:

#topmenu{margin-top:-30px;} /*Adjust to taste*/
0
 
s8webCommented:
BTW, it looks like you forgot to close your container div <div id="page-container">
0
 
EnclavetCommented:
I am attaching your site with the grey bar over the blue header image.

This is what I changed:

Under location.html:
I moved the <div id="topmenu"> to be inside the <div id="header">

Then in master.css:
I added to the topmenu class:
position: relative;
top: 20px;
left: -1px;

ExpertsExchange.zip
0
 
ob1_Author Commented:
Thanks Enclavet I will take a look at that. I tried the negative top-margin and that seems to work thank you!
Could you all please take a look at this and let me know if it looks ok: http://tampabobby.com/landing/locations.html
 
thanks,
bobby
0
 
EnclavetCommented:
Looks perfect in Firefox and IE8.
0
 
s8webCommented:
Looks good in Safari(pc) too.
0
 
ob1_Author Commented:
thanks!
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now