Solved

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

Posted on 2010-08-19
5
187 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS Divs in Safari 3 41
Button Css BootStrap 2 36
Synchronizing CSS load 3 30
compact pure CSS Read More Toggle 4 24
Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
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 …

861 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

22 Experts available now in Live!

Get 1:1 Help Now