Weblayout in HTML and CSS - Tryit Editor for Web Developers
Edit This Code:
See Result »
<html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: brown; } li { float: left; } li a { display: inline-block; color: white; text-align: center; padding: 16px 18px; text-decoration: none; } li a:hover { background-color: red; } .active { background-color: green; } </style> </head> <body> <h1>Navigation Menu:</h1> <p>Use float with a list of hyperlinks to create a horizontal menu:</p> <ul> <li><a href="#home" class="active">Home</a></li> <li><a href="#news">News</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#about">About</a></li> </ul> <br><br> <img src="logo.jpg"/> </body> </html>
Result: