Solved

How to define a special font-size to spaecial class in CSS

Posted on 2010-08-19
5
186 Views
Last Modified: 2012-05-10
Hi,
I have two types of links (<a href>
The main type I want to use font size=14px.
but in the class="small" type I want to use 10px.
I set the class to the small types and use the CSS that is attached.
But it doesn't work (all the fonts are displayed in the large size (14px).
Please note that if I change the A:link in the CSS to 10px than all the links are small (10px) but this is not what I want.
MyTree1280.css
0
Comment
Question by:VapiSoft
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:rajvja
ID: 33475978
Can you post your class declaration and HTML?
0
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33476129
CSS would be

a {font-size:14px;}
a.small {font-size:10px;}

Just ensure your small links are like...
<a href="google.com" title="" class="small">This is a small link</a>

should work fine
0
 

Author Comment

by:VapiSoft
ID: 33476583
doesn't work.
See the file.
MyTree1280.css
0
 
LVL 4

Accepted Solution

by:
Morrisproject earned 500 total points
ID: 33476999
ok,

Add this after each line for small font
a.small {font-size:10px !important;}

adding the ' !important' will mean it is more important than any other overriding styles.

If it still doesn't work, then post the html you are using. Thanks
0
 

Author Closing Comment

by:VapiSoft
ID: 33477525
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now