NameSilo

Html class problem

Spaceship Spaceship
Watch

softstor

Established Member
Impact
1
Look at the following two examples:

[A class="snip" href="site.com"]test1[/A]

[DIV class=snip]
[A href="site.com"]test2[/A]
[/DIV]


Please Note: <> was replaced with [] to show correctly in this message.

I am trying to get the hyperlink a specific color. In test1 it works correctly. But in test2 it does not work. Is it possible to get the hyperlink a specific color without changing the [A href="site.com"]test2[/A] line?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
If you wanted to keep the [A href] line, don't know. You can however, use JavaScript to act as the link, and then you could use your div tag.
 
0
•••
This changes text color:
HTML:
.snip {color:darkgreen;}

If you want to change the link color of a class, you need:
HTML:
.snip a {color: darkgreen;}
.snip a says is for the properties of the anchor tag contained in the snip class.
 
0
•••
or...

#snip a { color: darkgreen; }

and say [div id="snip"]
 
0
•••
HTML:
<span class="class"></span>

It's span, not div.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back