Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I Define Link Colours for a Div?

I'm trying to change the properties for the links in only one specific dev layer. Ideally I'd be able to have a code which kept every single link in the document the same colour despite it's status, but I don't think that's possible.

This is the coding that I have at the moment, but it's not working:

<head>
<style type="text/css">

body {
background-color:#B7B7B7;
background-image:url('http://pophatesfags.site90.net/pophatesfags.png');
background-repeat:no-repeat;
background-position:center top;
}

.text {
font-style: italic;
border-bottom:1px dashed black;
}

div.home {
a:link { color: #70DB93; }
a:visited { color: #70DB93; }
a:hover { color: #70DB93; }
a:active { color: #70DB93; }
}

</style>
</head>

<font color="70DB93"
<div id="home" class="div" style="position:absolute; width:715; height:42; left:27%; top:178px">
<span class="text">
<a href="http://www.pophatesfags.site90.net/home.html">home</font></a></div></style>

Any help would be greatly appreciated!

like image 635
Mo GaGarnsey Avatar asked Aug 18 '12 18:08

Mo GaGarnsey


People also ask

How do I make a link a certain color?

Link color using Hex color codes To start with we'll use a Hex color code, probably the most common method of adding color to links. In your HTML anchor tag (<a>), after the href attribute, insert a style attribute with the color property set to your Hex color code (in our case #FF0000).

How do I change the color of a link in a tag?

To change the color of links in HTML, use the CSS property color. Use it with the style attribute. The style attribute specifies an inline style for an element. Use the style attribute with the CSS property color to change the link color.

How do you hyperlink a div tag?

Create CSSSet the position to "absolute" for the inner <a> tag. Use the z-index property to place the link above all the other elements in the div.


1 Answers

I assume you want to change the color of the link in 'home' div. The CSS code will be -

#home a:link { color: #70DB93; }
#home a:visited { color: #70DB93; }
#home a:hover { color: #70DB93; }
#home a:active { color: #70DB93; }

Try it and let us know!

like image 68
some_other_guy Avatar answered Oct 19 '22 18:10

some_other_guy