HTML CSS examples for CSS Widget:Header
Set width on header bar
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .header-container {<!-- w ww . j ava 2 s.com--> background-color: red; height: 40px; width: 960px; } .header { height: 100%; line-height: 40px; margin: 0 auto; width: 960px; } .header img { vertical-align: middle; } .main-navigation { float: right; list-style: none; margin: 0; padding: 0; position: relative; } .main-navigation li { float: left; } .main-navigation a { color: red; font-weight: bold; text-decoration: none; } </style> </head> <body> <div class="header-container"> <div class="header"> <ul class="main-navigation"> <li> <a href="#">A</a> </li> <li> <a href="#">B</a> </li> <li> <a href="#">C</a> </li> <li> <a href="#">D</a> </li> <li> <a href="#">E</a> </li> </ul> <div class="clear"></div> </div> </div> </body> </html>