In modern Web Design sections of a page are often wrapped up in a container, which allows for easier positioning of the section and also allows additional styling.
The containers are often div tags.
In HTML5 a new purpose built element was created for main navigational links on a page - The nav element - which we will use as a container for the unordered list
<nav> unordered list </nav>
Many web pages have 2 main navigational sections, one for the site and the other for the page contents. Therefore 2 nav tags will be needed.
If we add styles to the nav element then both site & page menus would be styled the same.
In order to style them differently add a class to both nav elements with a different name for each
On our View Results pages We are using an Internal style sheets, allowing you can view the HTML and the CSS in the same document file.
In our results examples the
The CSS is in the Head Section
the HTML is in the Body Section
These sections are commented for easy finding
If your Navigational Menu is for a site, then use an External style sheet.
Html Add a <nav> tag to produce a Navbar
The <nav> tag defines a set of navigation links and is a new HTML5 element. That should be used for a major set of Navigation Links.
The tag will also allow you to add extra design to the Navbar Use a div tag if working on an earlier version of HTML.
Surround the unordered list with a nav tag.
Place the opening <nav> tag before the <ul> tag
Place the closing </nav> tag after the <ul> tag
Insert Classes
Insert class ="vertical" inside the opening <nav> tag
Insert class ="menu-vertical" inside the opening <ul> tag
With a 4 pixel wide border. Change the width as required. A width of 6px will achieve a far bolder effect & if you wish to experiment with different styles allows you to easily see the different style effect with a border width of 6px
With style ridge. The ridge style produces a 2 tone 3D effect. Experiment with other styles: solid, inset, outset, groove or double if required. Note groove reverses the border colour from the ridge style
With colour #960. Actually 2 colours one darker & one lighter than the specified colour when you use style ridge inset, outset or groove. Or use a colour to suit your colour site scheme
Add Rounded Corners
border-radius: 10px;
The radius sets the size of the rounded corner. 4px sets a small radius that can just be seen as a rounded corner. Less than 4 would be hard to see. The radius of the border on our headings on this page are to .9375 rem which equates to 15px
Set the width
width: 170px;
Sets the width to 170 pixels. If you wish to alter this width. The following may need adjusting:
Background Colour
background: #FD9;
Sets the background to #FD9. Or use a colour to suit your colour site scheme
This sets the margin from the top margin to 0 (zero) , then clockwise right & bottom margin to 0 (zero), finally the left margin to 10px. These margins provide space on the outside of the border. Set your own margins as required.
IMPORTANT
Do not add a size unit such as px after a 0 (zero) value.