Как да изкарам див отпред?

xlebabarov

Registered
Код:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Untitled Document</title>
</head>
<style type="text/css">
body{
background-color: #33FF00;
}
.main_logo{
	width: 907px;
	height:115px;
	margin-left: auto;
	margin-right:auto;
	margin-top: 0px;
}
.navbar_desen{
	z-index: 1;
	float: right;
	background-color: #FF0000;
	background-repeat: no-repeat;
	width: 14px;
	height: 61px;
}

.navbar_back{
	z-index: 1;
	position: relative;
	float: right;
	background-color: #FF0000;
	background-repeat:;
	height: 61px;
	width: 569px;
	}
.malko_logo{
	z-index: 1;
	float: left;
	width: 324px;
	height:139px;
	margin-left: 0;
	margin-right:auto;
	background-color: #FF0000;
	background-repeat: no-repeat;
	}
.tekst{
	right:0px;
	top:0px;
}
.sadarjanie{
	width: 907px;
	height: 600px;
	margin-left: auto;
	margin-right: auto;
	background-color: FFFFFF;
	background-repeat: no-repeat;
}
.menlink{
	margin-bottom: 0px;
	margin-right: 0px;
	width: 20px;
	height: 52px;
	background-color: FFFFFF;
}
</style>
<body>
<div class="main_logo">
	<div style="height: 77px; width: 583px; float:right;"></div>
	<div class="malko_logo"></div>
	<div class="navbar_desen">
		<div style="z-index: 2;position: inherit;float:right; background-color: #FFFFFF; background-repeat: no-repeat; width: 153px; height: 49px; background-position: center;"></div>
	</div>
	<div class="navbar_back"></div>
	
</div>
</body>
</html>

Това е краткото ми кодче... Как да изкарам див-а с белия фон пред останалите?

Код:
		<div style="z-index: 2;position: inherit;float:right; background-color: #FFFFFF; background-repeat: no-repeat; width: 153px; height: 49px; background-position: center;"></div>

Май с z-index не става :?:
 
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Untitled Document</title>
</head>
<style type="text/css">
body{
background-color: #33FF00;
}
.main_logo{
width: 907px;
height:115px;
margin-left: auto;
margin-right:auto;
margin-top: 0px;
}
.navbar_desen{
z-index: 1;
float: right;
background-color: #FF0000;
background-repeat: no-repeat;
width: 14px;
height: 61px;
}

.navbar_back{
z-index: 1;
position: relative;
float: right;
background-color: #FF0000;
background-repeat:;
height: 61px;
width: 569px;
}
.malko_logo{
z-index: 1;
float: left;
width: 324px;
height:139px;
margin-left: 0;
margin-right:auto;
background-color: #FF0000;
background-repeat: no-repeat;
}
.tekst{
right:0px;
top:0px;
}
.sadarjanie{
width: 907px;
height: 600px;
margin-left: auto;
margin-right: auto;
background-color: FFFFFF;
background-repeat: no-repeat;
}
.menlink{
margin-bottom: 0px;
margin-right: 0px;
width: 20px;
height: 52px;
background-color: FFFFFF;
}
</style>
<body>
<div class="main_logo">
<div style="height: 77px; width: 583px; float:right;"></div>
<div class="malko_logo"></div>
<div class="navbar_desen">
<div style="z-index: 2;position: absolute;float:right; background-color: #FFFFFF; background-repeat: no-repeat; width: 153px; height: 49px; background-position: center;"></div>
</div>
<div class="navbar_back"></div>

</div>
</body>
</html>

Става си с z-index, но трябва да е с position: absolute :]
 
ок, но като го позиционирам така, то трябва да му задам top и right, а така за всяка резолюция ще е проблем да задавам top и right?
 
Veselin_L каза:
Note: z-index only works on positioned elements (position:absolute, position:relative, or position:fixed).

може да опиташ с position:relative

:?: Благодаря и на двамата :?:
 

Back
Горе