Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you specify a:link style in a div class implementation?

I have an anchor tag in a ...

In my HTML, within the tag, I have

.foo {
     white-space:nowrap;
     text-shadow: 0 -1px 0 #000;
     color: #000;
     font-family: Helvetica Neue, Helvetica, arial;
     font-size: 12px;
}

How do I make it so that I can specify a:link {COLOR: #ffff;} in this class?

like image 777
Deshawn Avatar asked Jul 09 '11 20:07

Deshawn


People also ask

How do I add a link to a div class?

Create HTML Create a <div> with a class name "container". Use the <a> element to add the needed link.

How do I apply a style tag to a div?

The <div> tag defines a division or a section in an HTML document. The <div> tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript. The <div> tag is easily styled by using the class or id attribute. Any sort of content can be put inside the <div> tag!

How do I specify a link in CSS?

The :link selector is used to select unvisited links. Note: The :link selector does not style links you have already visited. Tip: Use the :visited selector to style links to visited pages, the :hover selector to style links when you mouse over them, and the :active selector to style links when you click on them.

How do I change the link color of a specific class in a div CSS?

Changing link color on hover using CSS You've probably noticed links changing color when you place your cursor on them, a stylish effect and one that's very easy to implement using CSS. To change the color of your link on hover, use the :hover pseudo property on the link's class and give it a different color.


1 Answers

If your structure is

<div class="foo"><a href="...">...</a></div>

You can style unvisited links thus:

.foo a:link {color: #fff;}

Note: use either 3 or 6 fs, not 4.

like image 102
Sam Ruby Avatar answered Nov 15 '22 04:11

Sam Ruby