Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Vertical Align Text within a Block

Featured Replies

Image below is what I am trying to achieve:

 

post-9213-0-80772400-1343330303_thumb.jpg

 

Image below is how far I have gotten with it:

 

post-9213-0-66104000-1343330433_thumb.jpg

 

Basically I don't know how to align the list items that are only 1 line to the middle of the box. My markup is below:

 

 

HTML

<nav class="clearfix">
 <ul id="main" class="clearfix">
   <li>
     <a href="">Home</a>
   </li>
   <li>
     <a href="">About Us</a>
   </li>
   <li>
     <a href="">Clients</a>
   </li>
   <li>
     <a href="">Fine<br />Wines</a>
     <ul>
       <li><a href="">Menu 1</a></li>
       <li><a href="">Menu 2 asd asd</a></li>
     </ul>
   </li>
   <li>
     <a href="">The Wine <br>
     Source Fund</a>
   </li>
 </ul>
</nav>

 

 

CSS

nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
nav ul#main li {
background-color: #000;
float: left;
}
nav ul#main li a {
display: block;
height: 40px;
padding: 5px 30px;
color: #FFF;
font-size: 10px;
text-decoration: none;
text-align: center;
border-right: 1px solid #900;
vertical-align: middle;
}
nav ul#main li a.last{
border-right: none;
}
nav ul#main li a:hover {
color: blue;
}
nav ul#main li ul  li{
float: none;
}
nav ul#main li ul  li a{
border-right: none;
}
nav ul#main li ul {
position: absolute;
display: none;
}
nav ul#main li:hover ul {
display: block;
}

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.