I am working with some markup for a drop down menu.
The markup is as follows:
<div class="select">
<a href="#" class="anchor menu-active">
<label>val1</label><span class="arrow"><label></label></span>
</a>
<div class="container menu-visible">
<ul>
<li>
<a value="val1" class="item-selected">val1</a>
</li>
<li>
<a value="val2333333333">val2333333333</a>
</li>
</ul>
</div>
</div>
The first arepresents a menu item, and the containerdiv represents a list of submenu items.
- The width of the submenu items is variable since they are generated dynamically.
- The text in the anchor is shown in bold, so in some cases the width of the anchor may be larger than the list of submenus.
: container, anchor . , , . , , anchor container.
CSS, , , anchor , container :
.container{
position: absolute;
}
.anchor{
font-weight: bold;
}
li{
background: blue;
}
ul{
display: inline-block;
}
.select{
background: red;
display: inline-block;
}
: http://jsfiddle.net/MxdQS/
CSS, , javascript, :
, , :

:
2 1 , , ?
- , ?