HTML CSS examples for CSS Widget:Image Text Alignment
Aligning image with text horizontally
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .navbar {<!-- w ww.ja v a2 s . co m--> width:100%; border-bottom:2px solid Chartreuse; box-shadow:0 2px 3px yellow; position:fixed; top:0; } .nav-logo { width:131px; height:59px; line-height:59px; display:block; float:left; } .nav-items { display:block; float:left; height:59px; line-height:59px; padding:5px 0 0 0; box-sizing:border-box; background-color:blue; } .nav-item { display:inline-block; font-size:21px; background:aqua; } </style> </head> <body> <div class="navbar"> <img src="https://www.java2s.com/style/demo/Safari.png" class="nav-logo"> <ul class="nav-items"> <li class="nav-item">Lorem ip</li> </ul> </div> </body> </html>