Reputation: 278
This is my code ` My Personal Website
<style>
html body{
margin:0;
padding:0;
}
.navbar-container {
position: absolute;
top:0;
width: 100%;
background-color: #283018;
}
.navigation-bar {
padding: 10px;
}
.nav-ul {
padding-top: 7px;
overflow:hidden;
padding-left: 540px;
list-style-type:none;
}
.nav-ul li {
color: white;
display: inline;
padding:50px;
text-align: center;
font-size: 1.1em;
float:left-inline;
}
.navbar-name h1 {
color: white;
float:left;
padding-left: 2px;
font-size: 1.5em;
}
.navbar-links a:link {
color: white;
text-decoration:none;
}
li a:link {
color:white;
}
.navbar-links li:hover, .navbar-links a:hover {
background-color: blue;
}
</style>
<body>
<nav class="navbar-container">
<div class="navigation-bar">
<div class="navbar-name">
<h1>Welcome to My Personal Site</h1>
</div>
<div class="navbar-links">
<ul class="nav-ul">
<li><a href="#">Home</a></li>
<li><a href="#">Profile</a></li>
<li><a href="#">My Works</a></li>
</ul>
</div>
</div>
</nav>
</body>
</html>`
I can't change the link in the navbar. this is the code that must change the link color but it can't
.navbar-links a:link {
color: white;
text-decoration:none;
}
I even tried to put
li a:link
but it does not work
The link color is unchangeable.
Sorry but I can't post screenshot
Upvotes: 3
Views: 82
Reputation: 854
Try this
.navbar-links li a {
color: white;
text-decoration:none;
}
Upvotes: 2