HTML CSS examples for CSS Widget:Nav Bar Item
Making a navigation bar item right aligned
<html lang="en"> <head> <title>Lorem ipsum dolor sit amet, consect</title> <style> .main {<!-- w ww . j a va 2 s . co m--> position:relative; } .main-nav { background-color:Chartreuse; display:flex; height:81px; position:fixed; width:100%; top:0; } a, a:link, a:visited { -webkit-transition:all 501ms ease; -moz-transition:all 501ms ease; -ms-transition:all 501ms ease; -o-transition:all 501ms ease; transition:all 501ms ease; color:yellow; padding:31px; text-decoration:none; text-transform:uppercase; } nav a:first-child { margin-left:auto; } </style> </head> <body translate="no"> <nav class="main-nav"> <a href="index3.html">Lore</a> <a href="about.html">Lorem</a> <a href="contact.html">Lorem i</a> <a href="directory.html">Lorem ips</a> </nav> </body> </html>