Jul 27, 2008

Easy Css Question

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

free web hosting

Easy Css Question

twoq
Ok i'm working with a css for just the font, but since I have the font as a link, it reverts back to making it blue and underlined. What am I doing wrong here? I think I am having a problem with the "selector" portion of this. I want my links to just show as a font, color, and size that I choose. No underlining.

in the head:
<title>2 G's Productions</title>
<style type="text/css">
<!--
P{
font-family: verdana;
font-size: 14px;
font-style: normal;
color: #000000;
}
-->
</style>
</head>

in the body:
<p><a href="company.htm">OUR COMPANY</a></p>

<p><a href="merch.htm">MERCHANDISE</a></p>

<p><a href="bios.htm">BIOS</a></p>

<p><a href="studio.htm">STUDIO</a></p>

<p><a href="events.htm">EVENTS</a></p>

<p><a href="contact.htm">CONTACT</a></p>

 

 

 


Reply

katif
You have to put in your css tags this:

A:link { text-decoration: none; color:#000000 ;
A:visited { text-decoration: none; color: #000000;
A:hover { text-decoration: none; color: #000000;}

Or whatever you want.
This: text-decoration: none; keeps away the underlining of your links wink.gif So this must be in, and you have to put the colour as well, without it the link will appear blue wink.gif

Reply

Becca
add

a:active { font-size:8pt;font-family:verdana;color: #000000; text-decoration: none;}
a:visited { font-size:8pt;font-family:verdana;color: #000000; text-decoration: none;}
a:link { font-size:8pt;font-family:verdana;color: #000000; text-decoration: none;}
a:hover { font-size:8pt;font-family:verdana;color: #000000; text-decoration: none;}

into the script or

A:link,A:visited,A:active { font-size:8pt;font-family:verdana;color: #000000; text-decoration: none;}

if you want them all to be the same

It's something like that


CODE


<title>2 G's Productions</title>
<style type="text/css">
<!--
P{
font-family: verdana;
font-size: 14px;
font-style: normal;
color: #000000;
}
a:active {
font-size:8pt;
font-family:verdana;
color: #000000;
text-decoration: none;
}
a:visited {
font-size:8pt;
font-family:verdana;
color: #000000;
text-decoration: none;
}
a:link {
font-size:8pt;
font-family:verdana;
color: #000000;
text-decoration: none;
}
a:hover {  
font-size:8pt;
font-family:verdana;
color: #000000;
text-decoration: none;
}
-->
</style>
</head>

in the body:
<p><a href="company.htm">OUR COMPANY</a></p>

<p><a href="merch.htm">MERCHANDISE</a></p>

<p><a href="bios.htm">BIOS</a></p>

<p><a href="studio.htm">STUDIO</a></p>

<p><a href="events.htm">EVENTS</a></p>

<p><a href="contact.htm">CONTACT</a></p>

 

 

 


Reply

FirefoxRocks
You could also do:
CODE
<a href="yourpage.html" style="color:rgb(0,0,0)">Link Display Text</a>


That would work, but the above ways are better.

Reply

electron
Well you could also give them class names.
In this way you could have multiple styles if you want for different categories of links on the page.
You could simultaneously define a global style by the above method.

To define a class :

CODE
.mya:link, .mya:visited, .mya:active {
font-size:11px;
font-family:verdana;
color: #000000;
text-decoration: underline;
}

.mya:hover {
font-size:11px;
font-family:verdana;
color: #999999;
text-decoration: none;
}


To use the class:

CODE
<a href="" class="mya">Link</a>


Hope that helps

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics
Looking for easy, css

Searching Video's for easy, css
advertisement



Easy Css Question



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE