Wednesday, November 24, 2010

How to change link color in Html code or CSS?

i'm pretty new to html , i'm working on dreamweaver, so basically i have pretty noob question...



i've made a link in the html page, when i click on it, it becomes purple (when the link was visited). I want to change that color, or at least, keep it black or without color if its possible.



do i change it in html or CSS? And how?



thank you in advanceHow to change link color in Html code or CSS?You can use this code:

%26lt;a href=%26quot;YOUR URL%26quot; style=%26quot;color: #CC0033%26quot;%26gt;DESCRIPTION HERE%26lt;/a%26gt;



without underline:

%26lt;a href=%26quot;YOUR URL%26quot; style=%26quot;color: #CC0033; text-decoration: none%26quot;%26gt;DESCRIPTION HERE%26lt;/a%26gt;



In CSS - under line:

a {

color: #66CC66;

}



without underline:

a {

color: #66CC66;

text-decoration: none;

}



for visited link color (in class):

:link {

color: #66CC66

}



:visited {

color: #840084

}



:active {

color: #66CC66

}How to change link color in Html code or CSS?It's very easy but it will require some coding ( you need to open code view in dreamweaver ).Suppose you made a link to Google.The HTML code will be like this



%26lt;a href=%26quot;www.google.co.in%26quot; target=%26quot;_blank%26quot;%26gt;

%26lt;font color=%26quot;black%26quot;%26gt;Google%26lt;/font%26gt;

%26lt;/a%26gt;



the second line %26lt;font=......%26gt;Google%26lt;/font%26gt; has to be added in between

first and third line.



If you really want to create good website then learn HTML.Sites made by dreamweaver have compatibility issues.They look different with different browsers.How to change link color in Html code or CSS?try this:



Make a css style tag in header area of html page like this:

%26lt;style type=%26quot;text/css%26quot;%26gt;



%26lt;/style%26gt;



now define a style for class %26quot;a%26quot; like this:

.a {

color:black; font:arial;

font-size: 14px;

}



.a:hover {

color:white; %26lt;------any color you want

}



.a:visited {

color:#999999; %26lt;------any color you want

}



now your final css coding will look like this:



%26lt;style type=%26quot;text/css%26quot;%26gt;



.a {

color:black; font:arial;

font-size: 14px;

}

.a:hover {

color:white; %26lt;------any color you want

}

.a:visited {

color:#999999; %26lt;------any color you want

}



%26lt;/style%26gt;



Hoping this would help u.How to change link color in Html code or CSS?Find Free CSS (Cascading Style Sheets) Books at : -



Basic Cascading Style Sheets (CSS) :: http://www.sharetermpapers.com/index.php



70 Expert Ideas for Better CSS :: http://www.sharetermpapers.com/index.php



CSS Guide for Office Live Websites :: http://www.sharetermpapers.com/index.php



Five Common CSS Hangups in Dreamweaver :: http://www.sharetermpapers.com/index.php



Core Web Programming CSS :: http://www.sharetermpapers.com/index.php