4 Replies - 728 Views - Last Post: 06 September 2007 - 05:17 PM

#1 asadarnell  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 108
  • Joined: 30-August 07

Making link propertites different in different CSS styles.

Post icon  Posted 31 August 2007 - 04:17 PM

This is a very simple question, I'm just a CSS noob.
Ok, I'm building a site, and am using CSS for the different styles. I'd like to know how to make links appear a certain way in only one style.

Example:
I have 2 main styles: .menu1 and .content1. The text is different colors in each, because of the color background they're on. The text in menu is #CCCCCC and content is #FFFFFF. I want the text in the style to stay the same color, and have an underline when it's a link. Like I said, I'm a noob to CSS. I'm partially using Dreamweaver, so if theres an easy way in there, that would help.


Thanks,
Asa


Edit: I got it to work. all I had to do was:
.menu1 {
	font-family: verdana;
	font-size: 12px;
	text-transform: lowercase;
	color: #CCCCCC;
}
.content A:hover
.content A:link
.content A:active {
.content {
	font-family: verdana;
	font-size: 11px;
	text-transform: none;
	color: #000000;
}

This post has been edited by asadarnell: 01 September 2007 - 06:24 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Making link propertites different in different CSS styles.

#2 Mike007  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 332
  • Joined: 30-August 07

Re: Making link propertites different in different CSS styles.

Posted 31 August 2007 - 05:04 PM

What you're looking for is using a tag selector and a class selector. Read about selectors here: http://www.w3.org/TR...2/selector.html.

What you want to do is something like that
a .menu1{
	//css style for menu class goes here[/indent]
}

a .content1{
	//css style for content1 class goes here
}



The way those 2 selectors read is something like: for every <a> tag that's class is set to content1/menu1. Selectors are the first thing you should learn about css, it is the way that a css style sheet determines what element gets what style.

GOOD LUCK! B)

This post has been edited by Mike007: 31 August 2007 - 05:06 PM

Was This Post Helpful? 0
  • +
  • -

#3 asadarnell  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 108
  • Joined: 30-August 07

Re: Making link propertites different in different CSS styles.

Posted 31 August 2007 - 05:48 PM

View PostMike007, on 31 Aug, 2007 - 05:04 PM, said:

What you're looking for is using a tag selector and a class selector. Read about selectors here: http://www.w3.org/TR...2/selector.html.

What you want to do is something like that
a .menu1{
	//css style for menu class goes here[/indent]
}

a .content1{
	//css style for content1 class goes here
}



The way those 2 selectors read is something like: for every <a> tag that's class is set to content1/menu1. Selectors are the first thing you should learn about css, it is the way that a css style sheet determines what element gets what style.

GOOD LUCK! B)

I looked at that link, and don't really understand it. I thought there'd be a style tag like "link: #000000" or soemthing that I could just implement into the sheet. Here's the CSS I have for the 2 styles:
.menu1 {
	font-family: verdana;
	font-size: 12px;
	text-transform: lowercase;
	color: #CCCCCC;
}
.content {
	font-family: verdana;
	font-size: 11px;
	text-transform: none;
	color: #000000;
}


I'll look at it some more and try to figure it out. Thanks.

This post has been edited by asadarnell: 31 August 2007 - 05:55 PM

Was This Post Helpful? 0
  • +
  • -

#4 Warebear  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 06-September 07

Re: Making link propertites different in different CSS styles.

Posted 06 September 2007 - 07:56 AM

I think what they are talking about is the different ways you can add classes to different tags for different items.

For all links in your .content class:
 a:hover,a:active,a:link content {
	text-decoration: none;
}



This would make everything in say <table class=content> that is a hyperlink have no underline whether it's hovered over or clicked on.

basically it's:
a content {style}

breaks down to:
(tag) (class) (style)

This post has been edited by Warebear: 06 September 2007 - 07:57 AM

Was This Post Helpful? 0
  • +
  • -

#5 asadarnell  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 108
  • Joined: 30-August 07

Re: Making link propertites different in different CSS styles.

Posted 06 September 2007 - 05:17 PM

View PostWarebear, on 6 Sep, 2007 - 07:56 AM, said:

I think what they are talking about is the different ways you can add classes to different tags for different items.

For all links in your .content class:
 a:hover,a:active,a:link content {
	text-decoration: none;
}



This would make everything in say <table class=content> that is a hyperlink have no underline whether it's hovered over or clicked on.

basically it's:
a content {style}

breaks down to:
(tag) (class) (style)

I figured it out. But thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1