html - how to make a navigation 100% width within an header wrapper -



html - how to make a navigation 100% width within an header wrapper -

i'm trying create navigation bar 100% width, distributes as within header has width of 100%. each a element has 2 words each, perfectlly center aligned under each other.

the html i'm working below:

<div class="nav"> <ul> <li><a href="#"><span style="font-family:sacramento; text-align: center;">our</span><br> home</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">about</span><br> us</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">client</span><br> works</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">contact</span><br> us</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">our</span><br> vision</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">our</span><br> bios</a></li> </ul> </div><!--end of nav-->

css i'm working with

.nav { position: relative; width: 100%; text-align: center; } .nav ul { margin: 0; padding: 0; } .nav li { margin: 25px 80px 10px 0; padding: 0; list-style: none; display: inline-block; text-align: center; } .nav { padding: 3px 12px; text-decoration: none; color: #999; line-height: 100%; font-family: actor; font-size: 20px; width: 10px; }

the illustration i'm trying create looks below :

update

when seek code in ie9, image :

please how can solve this.

to distribute items as set percentage width on list items. have 6 items add together width: 16%; .nav li rule.

to center align text change:

.nav { padding: 3px 12px; text-decoration: none; color: #999; line-height: 100%; font-family: actor; font-size: 15px; width: 10px; }

to (removed explicit width , added display: block):

.nav { padding: 3px 12px; text-decoration: none; color: #999; line-height: 100%; font-family: actor; font-size: 15px; display: block; }

lastly remove display: inline-block .nav li rule , add together float: left. should add together <div style="clear: both"></div> element below list (the tag) "fix" page flow.

html css navigation

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -