Mickeyatty Mickeyatty - 4 years ago 111
CSS Question

CSS Code Showing

My CSS code for

.header
and
.mtstyle
are now showing in my header when I preview. Nothing I have done has fixed the issue. This just started to happen. Thoughts? Also, is there a way to combine the
a:link
css into one line? Thanks.



.header {
position: absolute;
height: 45px;
right: 0;
top: 0;
left: 0;
background-color: white;
}

.mtstyle {
text-align: center;
margin-top: 5px;
margin-left:15px;
}

/* unvisited link */
.mtlstyle a:link {
color: #3399CC;
}

/* visited link */
.mtlstyle a:visited {
color: #3399CC;
}

/* mouse over link */
.mtlstyle a:hover {
color: none;
}

/* selected link */
.mtlstyle a:active {
color: #3399CC;
}

.mtlstyle a:link {
text-decoration: none;
}

.mtlstyle a:visited {
text-decoration: none;
}

.mtlstyle a:hover {
text-decoration: none;
}

.mtlstyle a:active {
text-decoration: none;
}

<div class="header">
<div class="mtstyle">
<div class="mtlstyle">
<h1><a href="index.php">Title</h1></a>
</div>
</div>
</div>




Answer Source

When you want to code, always try to close your open tags before put another tag in it!
For starter your HTML is incorrect in this line:
<h1><a href="index.php">Title</h1></a>
It should be:
<h1><a href="index.php">Title</a></h1>
you must enclose a tag first then close the h1. And you can always create CSS for multiple classes or behaviour with use of ",", like this:

a:hover, a:visited, a:active {
    text-decoration: none;
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download