1

html code:

<ul>
    <li><a href=#>Upload</a></li>
    <li><a href=#>christin Bayes</a></li>
    <li><img src="image/john.jpg" height="30" width="30"></li>  
    <li><a href=#>SignOut</a></li>
</ul>

css:

ul li
{
    margin-left: 15px;
    display: inline;
    list-style: none;
}

i want the list items(upload,name,signout) aligning middle exactly like in facebook. plz suggest me

fen
  • 9,835
  • 5
  • 34
  • 57
cowboy
  • 873
  • 7
  • 6

3 Answers3

1

try this: DEMO

HMTL:

<ul class="MenuBar">
    <li><a href=#>Upload</a></li>
    <li><a href=#>christin Bayes</a></li>
    <li><img src="image/john.jpg" height="30" width="30" /></li>   
    <li><a href=#>SignOut</a></li>
</ul>​

CSS:

.MenuBar
{
    padding: 0px;
    border: 1px solid #036;
    font-size: 8pt;
    height: 30px;
}

.MenuBar li
{
    display: inline;
    padding-left: 15px;
    list-style:none;
    height: 30px;
}

.MenuBar li img 
{
    vertical-align:middle;
}

​ Obviously you can choose to remove the border is only for testing.

fen
  • 9,835
  • 5
  • 34
  • 57
JellyBelly
  • 2,451
  • 2
  • 21
  • 41
0
img {
    vertical-align:middle;
}
​
j08691
  • 204,283
  • 31
  • 260
  • 272
0

Try this. May be it helps you:

ul{   
    background: red;
    height: 30px;
}
ul li{
    margin-left:15px;
    display: table-cell;
    list-style: none;
    vertical-align: middle;
    width: 90px;
    text-align: center;
}

jsfiddle

Dirty-flow
  • 2,306
  • 11
  • 30
  • 49
Xella
  • 1,283
  • 10
  • 10
  • Please do not simply post a fiddle as an answer. Answers should **always** include relevant code – Liam Mar 11 '14 at 11:12