Login | Register | FAQ
Anonymous

CSS link

+ Post a reply

4 posts Page 1 of 1


CSS link

by FunkyB » Tue Apr 29, 2014 7:55 pm

Hello

I hope you can help me. I am designing a website with use of .css file as shown below. For the navigation bar.

<link href="default.css" rel="stylesheet" type="text/css"/>

However it highlights all the other links on the page. I am finding this a headache. I don't know what to do. I can't of possibly done anything wrong?

Advise would be very much welcomed. Thanks in advance.
User avatar

FunkyB

  • Posts: 2
  • Joined: Tue Apr 29, 2014 7:49 pm

Re: CSS link

by FunkyB » Tue Apr 29, 2014 7:58 pm

Forgot to add this:

ul
{
list-style-type:none;
margin:0;
padding:10;
}
li
{
display:inline;
}
a:link,a:visited
{
color:#FFFFFF;
background-color:#B4CDCD;
text-align:center;
padding:10px;
text-decoration:none;
}
a:hover,a:active
{
background-color:#7A8B8B;
}
User avatar

FunkyB

  • Posts: 2
  • Joined: Tue Apr 29, 2014 7:49 pm

Re: CSS link

by comport9 » Sat May 31, 2014 12:52 am

It's applying your css rules to all links on the page because that's what you told it to do. If you want your navigation links to be styled differently from other links you have to use classes or id's to keep them separate. (Use classes...)

<a class="link" href="#">Stuff</a>

.link {
background-color: red;
}

Now, only links with the class "link" will be given the background colour "red".
User avatar

comport9

  • Posts: 28
  • Joined: Sun Nov 04, 2012 5:35 pm

Re: CSS link

by Veeramanikandan » Thu May 07, 2015 3:13 pm

<link rel="stylesheet" type="text/css" href="style.css">
set the background-color:red; on your css file its simple way to find our link has been work or not
User avatar

Veeramanikandan

  • Posts: 20
  • Joined: Mon Sep 22, 2014 4:03 pm


+ Post a reply

Page 1 of 1