PDA

View Full Version : A minor problem with styling my links



mitchrenton
07 Jan 2008, 08:13 AM
Im just starting out in the xhtml css world so forgive me for my probably very simple and silly question! but none the less...

im styling my text links in my site via the <a> tag. But i want the font sizes in two seperate divs to be different. how do i combine the <a> with a specific div so that i can apply different font-sizes?

any help would be hugely appriciated!

Mitch

bjk2007
24 Feb 2008, 04:10 PM
Give your <div>'s an id like this:


<div id="cart"><a>Go shopping</a></div>
<div id="advertisement"><a>Win something now!</a></div>

Then, you can use css to style it like this


#cart a{
color:#00ff00; /* Green Link Text */
}
#advertisement a{
font-size:10em; /* Ridiculously huge link text */
}

You can give any element you want an id to uniquely identify it. There's plenty of information available here and on google if you need more help. You might want to research css classes as well; they have a pretty similar purpose but are for a slightly different situation.