Jump to content
  • 0

width 100% ie6 must die


Dessss
 Share

Question

Вообще дроп даун ксс меню.

<div class="nav">

<ul class="nav-menu">

<li><a href="#"><strong>LA CAVE<em>Rencontrez-nous !</em></strong><span></span> </a>

<ul>

<li><a href="#">Item 1</a></li>

<li><a href="#">Item 2 over</a></li>

<li><a href="#">Item 3</a></li>

</ul>

</li>

.nav ul{

margin:-37px 0 0 0;

padding:0;

list-style:0;

float:right;

}

.nav ul li{

background:url(../images/bg-nav-li.gif) no-repeat 100% 100%;

list-style: none;

padding: 0 15px 0 0;

float: left;

position: relative;

}

.nav ul li a{

overflow: hidden;

text-decoration: none;

display:block;

position:relative;

}

.nav ul li a strong{

background:url(../images/bg-nav.png) no-repeat ;

list-style: none;

height: 33px;

float: left;

color: #fff;

font: 11px Arial, Helvetica, sans-serif ;

padding: 10px 25px 0 10px;

}

.nav ul li a em{

color: #d1cdc7;

font-size: 11px;

font-style: normal;

display: block;

}

.nav ul li a span{

background:url(../images/bg-nav-r.png) no-repeat ;

width: 7px;

height: 43px;

float: left;

}

.nav li ul{

position: absolute;

padding: 0;

margin: 0;

top: 43px;

left: 0px;

display: block;

width:100%;

}

В двух словах есть ul в ней li притом тянется по ширине и фиксированная по высоте. В li вложенно выпадающее меню ul. Так вот надо что бы ширина дроп дауна равнялась ширине li. Юзаю на дроп даун ul width:100% все ок но в IE 6 тянет весь дроп даун на весь экран. Что делать? Рабочий пример тут http://des.svdteam.com/boshoeve/

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

такое пойдет?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css"><!--
ul.nav{
margin:0;
padding:0;
list-style:none;
height:1%;
font:10px/14px Tahoma,Arial,sans-serif;
}
ul.nav:after{
content:"";
display:block;
clear:both;
}
.nav li{
background:url(bg-nav-li.gif) no-repeat 100% 100%;
padding:0 15px 0 0;
float:left;
position:relative;
}
.nav a{
float:left;
text-decoration:none;
}
.nav a strong{
background:url(bg-nav.png) no-repeat;
height:33px;
float:left;
color:#fff;
font:11px Arial,Tahoma,sans-serif;
padding:10px 25px 0 10px;
}
.nav a em{
color:#d1cdc7;
font-size:11px;
font-style:normal;
display:block;
}
.nav a span{
background:url(bg-nav-r.png) no-repeat;
width:7px;
height:43px;
float:left;
}
.nav ul{
position:absolute;
top:43px;
left:0px;
padding:0;
margin:0;
list-style:none;
width:100%;
_width:expression(this.parentNode.offsetWidth+'px');
}
.nav ul li{
background:#a29b8e url(bg-marker-drop.gif) no-repeat 7px 5px;
border:1px solid #7B7569;
float:none;
margin:-1px 17px 0 0;
padding:1px 0 0;
}
.nav ul a{
color:#d1cdc7;
padding:0 0 0 22px;
float:none;
display:block;
height:1%;
}
--></style>
</head>
<body>
<ul class="nav">
<li><a href="#"><strong>LA CAVE<em>Rencontrez-nous !</em></strong><span></span></a>
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2 over</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</li>
<li><a href="#"><strong>LA CAVE<em>DГ©couvrez et achetez !</em></strong><span></span></a>
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2 over</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</li>
</ul>
</body>
</html>

Edited by mishka2
Link to comment
Share on other sites

  • 0

а это если захочешь сделать минимальную ширину (на случай если родительская лишка будет слишком короткая)

.nav ul{
width:100%;
min-width:160px;
_width:expression(this.parentNode.offsetWidth<160?'160px':this.parentNode.offsetWidth+'px');
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy