Horizontal header menu implemented with CSS3

Horizontal header menu implemented with CSS3

Result:

Implementation Code

html

<nav class="dropdownmenu">
  <ul>
    <li><a href="http://www.jochaho.com/wordpress/">123WORDPRESS.COM</a></li>
    <li><a href="http://www.jochaho.com/wordpress/about-pritesh-badge/">jb51</a></li>
    <li><a href="#">Articles on HTML5 & CSS3</a>
      <ul id="submenu">
        Difference between SVG vs. Canvas
        <li><a href="http://www.jochaho.com/wordpress/new-features-in-html5/">New features in HTML5</a></li>
        <li><a href="http://www.jochaho.com/wordpress/creating-links-to-sections-within-a-webpage/">Creating links to sections within a webpage</a></li>
      </ul>
    </li>
    <li><a href="http://www.jochaho.com/wordpress/category/news/">News</a></li>
    <li><a href="http://www.jochaho.com/wordpress/about-pritesh-badge/">Contact Us</a></li>
  </ul>
</nav>

CSS3

.dropdownmenu ul, .dropdownmenu li {
	margin: 0;
	padding: 0;
}
.dropdownmenu ul {
	background: gray;
	list-style: none;
	width: 100%;
}
.dropdownmenu li {
	float: left;
	position: relative;
	width:auto;
}
.dropdownmenu a {
	background: #30A6E6;
	color: #FFFFFF;
	display: block;
	font: bold 12px/20px sans-serif;
	padding: 10px 25px;
	text-align: center;
	text-decoration: none;
	-webkit-transition: all .25s ease;
	-moz-transition: all .25s ease;
	-ms-transition: all .25s ease;
	-o-transition: all .25s ease;
	transition: all .25s ease;
}
.dropdownmenu li:hover a {
	background: #000000;
}
#submenu {
	left: 0;
	opacity: 0;
	position: absolute;
	top: 35px;
	visibility: hidden;
	z-index: 1;
}
li:hover ul#submenu {
	opacity: 1;
	top: 40px; /* adjust this as per top nav padding top & bottom comes */
	visibility: visible;
}
#submenu li {
	float: none;
	width: 100%;
}
#submenu a:hover {
	background: #DF4B05;
}
#submenu a {
	background-color:#000000;
}

The above is the details of the horizontal title menu implemented by CSS3. For more information about CSS3 title menu, please pay attention to other related articles on 123WORDPRESS.COM!

<<:  Detailed explanation of TypeScript's basic types

>>:  Detailed explanation of the code for implementing six sieve styles using HTML grid layout

Recommend

Example code for using text-align and margin: 0 auto to center in CSS

Use text-align, margin: 0 auto to center in CSS W...

Description of the default transaction isolation level of mysql and oracle

1. Transaction characteristics (ACID) (1) Atomici...

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...

The benefits of div+css and web standard pages

The div element is used to provide structure and b...

Detailed explanation of the use of ElementUI in Vue

Login + sessionStorage Effect display After a suc...

Detailed explanation of common Docker commands

1. Help Command 1. View the current Docker versio...

A brief discussion on the font settings in web pages

Setting the font for the entire site has always b...

A brief discussion on the use of React.FC and React.Component

Table of contents 1. React.FC<> 2. class xx...

How to convert rows to columns in MySQL

MySQL row to column operation The so-called row-t...

MySQL column to row conversion, method of merging fields (must read)

Data Sheet: Column to row: using max(case when th...