www.webdeveloper.com
Results 1 to 3 of 3

Thread: Hi, please help me fix this layout ! Navigation Bar related Issue

  1. #1
    Join Date
    Nov 2013
    Posts
    3

    Hi, please help me fix this layout ! Navigation Bar related Issue

    Hi, I have a navigation bar nested inside <nav> element. [HTML5].
    I'm running into a trouble and this is what i expect.
    Attachment 15873

    But I'm getting this.
    Attachment 15875

    Html file's here.
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    	<title>Gaurab Parajuli Webpage</title>
    	<style type="text/css">
    		#Container {
    			width: 960px;
    			margin: auto;
    		}
    		header {
    			height: 120px;
    			width: 960px;
    			background-color: grey;
    		}
    		header nav {
    			background-color: #98bf21;
    			width: 960px;
    			height: 20px; 
    		}
    		header nav ul {
    			list-style-type: none;
    		}
    		header nav ul li{
    			float: left;
    		}
    		header nav ul li a:link, header nav ul li a:visited {
    			text-decoration: none;
    			color: #ffffff;
    			background-color: #98bf21;
    			text-transform: uppercase;
    			font-weight: lighter;
    			padding: 10px;
    		}
    		header nav ul li a:hover,header nav ul li a:active {
    			background-color: #7A991A;
    		}
    	</style>
    </head>
    <body>
    	<div id="Container">
    		<header>
    			<nav>
    				<ul>
    					<li><a href="#">Home</a></li>
    					<li><a href="#">Softwares</a></li>
    					<li><a href="#">Portfolio</a></li>
    					<li><a href="#">About Me</a></li>
    					<li><a href="#">Contact Me</a></li>
    				</ul>
    			</nav>
    		</header>
    		<section>
    			<h1 id="Welcome">Welcome to my website</h1>
    			<p>A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog.</p>
    		</section>
    		<aside>
    			<h2 class="Sidebar-title">This is a side bar</h2>
    			<p>A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog. A quick brown fox jumps over a lazy dog.</p>
    		</aside>
    		<footer>
    			<p>Copyright Gaurab Parajuli 2013</p>
    		</footer>
    	</div>
    </body>
    </html>
    Also explain what you did.
    Last edited by Gaurab; 11-19-2013 at 06:32 AM.

  2. #2
    Join Date
    Nov 2013
    Location
    new york
    Posts
    68
    put display block to anchor link. Everything will come to normal.
    .header nav ul li a { display: block; }

    And one more thing. Why you are giving height every time. As a web designer we should not use height property many time. We have to use height property wherever it is necessary.

  3. #3
    Join Date
    Nov 2013
    Posts
    3
    well, i tried that but that didn't solve the problem either.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles