edited by AlfredoBot
, Maluniu, proofreader
HTMLCSS a dropdown menu gives a clear and hierarchical listing of all main and subcomponents of Web page To the subcomponents appear’s. you just have to hover your mouse above the main parts. Follow the steps below to build your own menu, adapted to your wishes. In addition, at every step images added to make it more clearly. We’ll start with the HTML-code, followed by applying
CSS for formatting.
Steps method 1 of 2:
create a framework in HTML for the CSS menu. We use \ ‘ \ ‘ div with class = ” nav ” . As you can see on the left is the HTML code a simple list of UL’s for the main components of the menu.
add links for the submenu under ” About Us ” by adding an unordered list inside LI from the main menu.
add CSS to your HTML. What we have now is a structure in HTML in a convenient layout of links, in which the sub menu’s in a clear relationship are at the main menu. We are now going to attach an external CSS file, by adding the following link in the \ ‘ head \ ‘ section of the
Method 2 of 2:
create a CSS file. Now we are done with the HTML structure, we can continue with the formatting through CSS, to make sure that it really functions and menu will look like as we want. Using CSS-selectors we can appeal to individual elements in the HTML structure without the need for additional ID’s or classes. We hide submenu’s by the UL’s within a LI with the Declaration display: none; To ensure that the menu’s tevoorschijnkomen again if you exceed the LI is floating, they must be converted to \ ‘ block elements \ ‘; the > ensures that only the child-UL of the LI above which is floated along, is addressed.
the formatting of the main menu with CSS. position: relative; this positioning you compared to the main menu the submenu (main nav bar) display: inline-block; change the width of the menu to fit.
Add a gradient and change the font color when you hovers over an item. The following code is added to the LI tags, making changes the background color of the link and the text becomes white.
change the formatting of the submenu’s. Currently inherit the submenu’s parent elements style \ ‘ \ ‘ (the main menu). We want them vertically and placed under the main menu list.
This article is automatically posted by WP-Auto Post: WordPress pluginArticle Source Settings, WP-Autoblog Auto Post