


Vertical secondary navigation implemented in pure css3_html/css_WEB-ITnose
I have shared a lot of navigation menus with you before. Today I bring you a vertical secondary navigation implemented purely in CSS3. This navigation menu can be infinite. Let’s take a look at the renderings:
Online preview Source code download
Implemented code.
html code:
<div style="width: 700px; margin: auto;"> <div class="W1-h16"> <ul> <li class="has-sub"><a href="#">Menu 1</a> <ul> <li class="has-sub"><a href="#">Submenu 1.1</a> <ul> <li><a href="#">Submenu 1.1.1</a></li> <li class="has-sub"><a href="#">Submenu 1.1.2</a> <ul> <li><a href="#">Submenu 1.1.2.1</a></li> <li><a href="#">Submenu 1.1.2.2</a></li> </ul> </li> </ul> </li> <li><a href="#">Submenu 1.2</a></li> </ul> </li> <li class="has-sub"><a href="#">Menu 2</a> <ul> <li><a href="#">Submenu 2.1</a></li> <li><a href="#">Submenu 2.2</a></li> </ul> </li> <li class="has-sub"><a href="#">Menu 3</a> <ul> <li><a href="#">Submenu 3.1</a></li> <li><a href="#">Submenu 3.2</a></li> </ul> </li> </ul> </div> </div>
css3 code:
.W1-h16 { padding: 0; margin: 0; border: 0; line-height: 1;}.W1-h16 ul,.W1-h16 ul li,.W1-h16 ul ul { list-style: none; margin: 0; padding: 0;}.W1-h16 ul { position: relative; z-index: 500; float: left;}.W1-h16 ul li { float: left; min-height: 0.05em; line-height: 1em; vertical-align: middle; position: relative;}.W1-h16 ul li.hover,.W1-h16 ul li:hover { position: relative; z-index: 510; cursor: default;}.W1-h16 ul ul { visibility: hidden; position: absolute; top: 100%; left: 0px; z-index: 520; width: 100%;}.W1-h16 ul ul li { float: none;}.W1-h16 ul ul ul { top: 0; right: 0;}.W1-h16 ul li:hover > ul { visibility: visible;}.W1-h16 ul ul { top: 0; left: 99%;}.W1-h16 ul li { float: none;}.W1-h16 ul ul { margin-top: 0.05em;}.W1-h16 { width: 13em; background: #333333; font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; zoom: 1;}.W1-h16:before { content: ''; display: block;}.W1-h16:after { content: ''; display: table; clear: both;}.W1-h16 a { display: block; padding: 1em 1.3em; color: #ffffff; text-decoration: none; text-transform: uppercase;}.W1-h16 > ul { width: 13em;}.W1-h16 ul ul { width: 13em;}.W1-h16 > ul > li > a { border-right: 0.3em solid #1b9bff; color: #ffffff;}.W1-h16 > ul > li > a:hover { color: #ffffff;}.W1-h16 > ul > li a:hover,.W1-h16 > ul > li:hover a { background: #1b9bff;}.W1-h16 li { position: relative;}.W1-h16 ul li.has-sub > a:after { content: '»'; position: absolute; right: 1em;}.W1-h16 ul ul li.first { -webkit-border-radius: 0 3px 0 0; -moz-border-radius: 0 3px 0 0; border-radius: 0 3px 0 0;}.W1-h16 ul ul li.last { -webkit-border-radius: 0 0 3px 0; -moz-border-radius: 0 0 3px 0; border-radius: 0 0 3px 0; border-bottom: 0;}.W1-h16 ul ul { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;}.W1-h16 ul ul { border: 1px solid #0082e7;}.W1-h16 ul ul a { color: #ffffff;}.W1-h16 ul ul a:hover { color: #ffffff;}.W1-h16 ul ul li { border-bottom: 1px solid #0082e7;}.W1-h16 ul ul li:hover > a { background: #4eb1ff; color: #ffffff;}.W1-h16.align-right > ul > li > a { border-left: 0.3em solid #1b9bff; border-right: none;}.W1-h16.align-right { float: right;}.W1-h16.align-right li { text-align: right;}.W1-h16.align-right ul li.has-sub > a:before { content: '+'; position: absolute; top: 50%; left: 15px; margin-top: -6px;}.W1-h16.align-right ul li.has-sub > a:after { content: none;}.W1-h16.align-right ul ul { visibility: hidden; position: absolute; top: 0; left: -100%; z-index: 598; width: 100%;}.W1-h16.align-right ul ul li.first { -webkit-border-radius: 3px 0 0 0; -moz-border-radius: 3px 0 0 0; border-radius: 3px 0 0 0;}.W1-h16.align-right ul ul li.last { -webkit-border-radius: 0 0 0 3px; -moz-border-radius: 0 0 0 3px; border-radius: 0 0 0 3px;}.W1-h16.align-right ul ul { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px;}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.
