PDA

View Full Version : to creat a new style link ?



OKtrust
January 23rd, 2005, 12:53 PM
hi all,
can you tell me how to create a new class which contain a new link style

although I create two class but just .style3 ...effect whole page
It really make me crazyyyyyy

please help me.




.style1 {font-size: 11px}
a:link {
color: #993300;
}
a:visited {
color: #993300;
}
a:hover {
color: #CC3300;
}
a:active {
color: #993300;

.style3 {font-size: 11px}
a:link {
color: #ff0000;
}
a:visited {
color: #ff0000;
}
a:hover {
color: #ff0000;
}
a:active {
color: #ff0000;
}

Kristopher
January 23rd, 2005, 01:07 PM
Yeah it's pretty easy actually. At the top of our code, you can declare the original link attributes, like this:


a, a:visited {
color: #CCC;
text-decoration: none;
}

a:hover {
color: #993333;
text-decoration: underline;
}


Then you can create a div ID that will be selected by a div in your XHTML code. So do something like this:


div#content {
width: 600px;
margin: 0px;
padding: 25px;
background: #FAFAFA;
}


Then, you declare within that ID your different link attributes. For example:


div#content a,a:visited {
color: #555;
text-decoration: underline;
font-varient: smallcaps;
}
div#content a:hover {
color: #FFAAAA;
text-decoration: underline, overline;
}


Do you see what I'm talking about or does it need more explaination?

OKtrust
January 24th, 2005, 10:38 AM
oh fotunately: it work well !


<div id="content">text <a href="http://yahoo.com" >blah balh ... </a></div>


thanks man, that's all I need ! who says HTML is easy ? but I dont :))

OKtrust
January 24th, 2005, 11:55 AM
hehe here is for you Kristopher:


<div id="glow_text">wow !</div>

<SCRIPT language=javascript>
glow_color="ffaa00"
glow_min=1
glow_max=5
glow_speed=80

function f_glow(){
glow_size+=glow_const
if (glow_size>glow_max || glow_size<glow_min) glow_const*=(-1)
document.all.glow_text.style.filter = "glow(color="+glow_color+", strength="+glow_size+")"
}
if(document.all){glow_const=1; glow_size=glow_min; document.all.glow_text.style.width="100%"; setInterval("f_glow()",glow_speed)}
</SCRIPT>

Kristopher
January 24th, 2005, 12:02 PM
Yeah I've seen that before. Pretty sweet stuff :).