Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-14-2013, 12:31 AM   PM User | #1
mmslax2
New to the CF scene

 
Join Date: Jan 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mmslax2 is an unknown quantity at this point
Placing an Element in a Navbar

Hello everybody,

I've been searching the forums/internet for a solution but haven't been able to find anything, if something similar has been posted please forgive my ignorance.

I'm trying to place a logo ontop of a navbar, like the one done here. I've tried positioning the logo absolutely, floating it, etc. Everytime I do so the logo image appears behind the navbar. I've tried using z-index as well to no avail.

Does anyone have any suggestions that could solve this issue? It would be much appreciated!
mmslax2 is offline   Reply With Quote
Old 03-14-2013, 06:27 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,392
Thanks: 18
Thanked 351 Times in 350 Posts
sunfighter is on a distinguished road
Link does not work.
Your solution is the same as if you have two boxes, one overlaying the other.
My image in the code is just a blue box. Substitute yours and check it out.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<style type="text/css">
#over{
	position:absolute;
	left: 500px;
	z-index:100;
}
#nav{
	background-color:gray;
	color:white;
	width: 600px;
	height: 100px;
	position:absolute;
	left: 50px;
	top:50px;
	padding:45px 0 0 400px;"
}
</style>
</head>
<body>
<img id="over" src="images/2dig2du.gif" height="120" width="50" alt="" />
<div id="nav" id="navbar" >
Big Small Great Less
</div>
</body>
</html>
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 11:37 PM.


Advertisement
Log in to turn off these ads.