hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Design and Content : Simple CSS question
Reply

Web Design and Content Subjects include, HTML, graphics, editors, CSS, Flash, graphics creation, placing of ads, ad serv companies, copyright, content and nearly anything else design related. Also talk about businesses that provide design services. If you link to your site, you must post in Web Site Reviews.
Forum Jump

Simple CSS question

Reply Post New Thread In Web Design and Content Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-16-2003, 09:17 AM
StoaVio StoaVio is offline
Junior Guru Wannabe
 
Join Date: Aug 2002
Posts: 74

Simple CSS question


I'm looking to assign a different color, font, weight and size variable to some of the links on my site. For example, in the content area the links look a certain way but in the header I'd like them to appear differently. How can I do this? Would I use classes? By the way, I'm using an external style sheet. I'm kinda new to CSS.
Right now for example the main links look like this:

A:link {
color: #eeeeee;
text-decoration: underline;
font-weight: demi-bold;
}

A:hover {
color: #eeeeee;
text-decoration: underline;
font-weight: demi-bold;
}

------------------------------------------------------------------
Now, how would I make it so other links have different font/color/weight variables?
Would it be something like this?
------------------------------------------------------------------

A:link.class1 {
color: #000000;
text-decoration: blink;
font-weight: light;
}

A:hover.class1 {
color: #eeeeee;
text-decoration: underline;
font-weight: demi-bold;
}

------------------------------------------------------------------------

Like I said, I'm kinda new to CSS. Can someone help please?

Reply With Quote


Sponsored Links
  #2  
Old 09-16-2003, 10:53 AM
scarr105 scarr105 is offline
Newbie
 
Join Date: Sep 2003
Posts: 9
.Class1 a:visited{
color:#881C11;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bolder;
text-decoration: none;
}
.Class1 a:link{
text-decoration:none;
color:881C11;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bolder;
}
.Class1 a:active{
color:881C11;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bolder;
text-decoration: none;
}
.Class1 a:hover{
text-decoration:none;
color:B23427;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bolder;
}

Reply With Quote
  #3  
Old 09-16-2003, 02:05 PM
platinum platinum is offline
Aspiring Evangelist
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 405
Code:
a:link, a:visited, a:active, a:hover {
  color: #eeeeee;
  text-decoration: underline;
  font-weight: demi-bold;
}

a:hover {
  text-decoration: none;
}
That will set it all up for all "states". The underline disapears when you hover over it

Reply With Quote
Sponsored Links
  #4  
Old 09-16-2003, 03:14 PM
StoaVio StoaVio is offline
Junior Guru Wannabe
 
Join Date: Aug 2002
Posts: 74
Yea, I know how to setup the original states for links but what about links that I'd like to give other appearances too? What do I do for those? Would I assign a class or id?

Reply With Quote
  #5  
Old 09-16-2003, 03:30 PM
rrdega rrdega is offline
Web Hosting Master
 
Join Date: May 2003
Location: Heartland, USA
Posts: 733
I think your first reply had that... Though that is not how I have done it. Here's a snippet of a page (urls mod'd) that works:
Code:
a:link.class1 {
  color: #606060;
  background: transparent;
  text-decoration: none;
}

a:visited.class1 {
  color: #606060;
  background: transparent;
  text-decoration: none;
}

a:active.class1 {
  color: #606060;
  background: transparent;
  text-decoration: none;
}

a:hover.class1 {
  color: #606060;
  background: transparent;
  text-decoration: underline;
}
And the HTML:
Code:
<a class="class1" href="http://www.yadaDomain.com" target="_blank">Yada, yada</a>
Though, based on the other reply, it could probably be done cleaner...

Reply With Quote
  #6  
Old 09-16-2003, 03:59 PM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
It should be

tag.classname:property {

}

so for the a links above with class defined would be

a.class1 {
color: #606060;
background: transparent;
text-decoration: none;
}

a.class1:hover {
color: #606060;
background: transparent;
text-decoration: none;
}

Reply With Quote
  #7  
Old 09-17-2003, 09:15 AM
StoaVio StoaVio is offline
Junior Guru Wannabe
 
Join Date: Aug 2002
Posts: 74
Thanks a lot guys!

Reply With Quote
  #8  
Old 09-17-2003, 09:16 AM
StoaVio StoaVio is offline
Junior Guru Wannabe
 
Join Date: Aug 2002
Posts: 74
I didn't know you could give anchors a class
<a class="" href="">link here</a>)

Reply With Quote
  #9  
Old 09-17-2003, 10:22 AM
rrdega rrdega is offline
Web Hosting Master
 
Join Date: May 2003
Location: Heartland, USA
Posts: 733
Quote:
Originally posted by StoaVio
I didn't know you could give anchors a class
<a class="" href="">link here</a>)
Yeppers! 'n, by the way, Rich's syntax is the Correct method... I have no idea where I came up with what I was using (and it did work), but I have now changed my sites' CSSs to use the correct syntax...

Thanx Rich!

Reply With Quote
  #10  
Old 09-17-2003, 02:54 PM
StoaVio StoaVio is offline
Junior Guru Wannabe
 
Join Date: Aug 2002
Posts: 74
Thanks guys! I really appreciate it. You're awesome

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Joomla Hosting Study Shows Speed, Uptime Top Selling Points of a Web Host Web Hosting News 2012-11-07 15:06:36
Video Demo: Yola Website Building Software Whir Tv 2012-05-14 16:05:42
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
Namesco Provides Free Domains for Companies Made Simple Customers Web Hosting News 2012-01-31 13:36:44
Web Host Simple Hosting Partners with SpamExperts Web Hosting News 2011-09-09 17:02:09


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?