Zaloguj | Zarejestruj | FAQ
Anonymous

CSS link

+ Odpowiedz

Posty: 4 Strona 1 z 1


CSS link

przez FunkyB » Wt kwi 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.
Avatar użytkownika

FunkyB

  • Posty: 2
  • Dołączył(a): Wt kwi 29, 2014 7:49 pm

Re: CSS link

przez FunkyB » Wt kwi 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;
}
Avatar użytkownika

FunkyB

  • Posty: 2
  • Dołączył(a): Wt kwi 29, 2014 7:49 pm

Re: CSS link

przez comport9 » So maja 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".
Avatar użytkownika

comport9

  • Posty: 28
  • Dołączył(a): N lis 04, 2012 5:35 pm

Re: CSS link

przez Veeramanikandan » Cz maja 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
Avatar użytkownika

Veeramanikandan

  • Posty: 20
  • Dołączył(a): Pn wrz 22, 2014 4:03 pm


+ Odpowiedz

Strona 1 z 1