Jump to content
  • 0

Выровнять текст меню по вертикали


DrMartens
 Share

Question

Есть вертикальное меню, когда пункты меню короткие и вмещаются в 1у строку, все хорошо, но как сделать так что бы если текст не вмещается в 1 строчку он становился в 2е строчки но при этом становился по центру пункта меню.

<ul id="left-menu-e" class="menu">
<li class="level1 item1 first">
<a class="level1 item1 first" href="#">
<span class="bg">Link link link</span>
</a>
</li>
<li class="level1 item2">
<a class="level1 item2" href="#">
<span class="bg">Link link link</span>
</a>
</li>
<li class="level1 item3 last">
<a class="level1 item3 last" href="#">
<span class="bg">Link link link</span>
</a>
</li>
</ul>

Со стилями:

ul#left-menu-q{
height: 354px;
margin: 0;
padding: 0;
background: url("../images/menus/left/rshad-l-m.png") no-repeat scroll center right transparent;
}

ul#left-menu-q li{
height:46px;
border-top:1px solid #929293;
}
ul#left-menu-q li:last-child{
border-bottom:1px solid #C9C9C9;
}

ul#left-menu-q li:first-child{
border-top:1px solid #C9C9C9;
}

ul#left-menu-q li a{
cursor: pointer;
display: block;
height: 46px;
width: 210px;
padding-left:13px;
}

ul#left-menu-q li a:hover, ul#left-menu-q li.active a{
text-decoration:none;

background:#efeeee;
}

ul#left-menu-q li a:hover span
{color:#7ca4d6;}

ul#left-menu-q li a span{
font:bold 11px/46px arial;
color:#414042;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

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