/    Sign up×
Community /Pin to ProfileBookmark

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.
[ATTACH]15873[/ATTACH]

But I’m getting this.
[ATTACH]15875[/ATTACH]

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>
[/CODE]

Also explain what you did.

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@arronmattwillsNov 26.2013 — 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.
Copy linkTweet thisAlerts:
@GaurabauthorNov 27.2013 — well, i tried that but that didn't solve the problem either.
×

Success!

Help @Gaurab spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...