6 replies [Last post]
aryastark
Offline
Regular
Last seen: 16 years 27 weeks ago
Joined: 2004-07-22
Posts: 18
Points: 0

Hi all,
Is there a css tag that can universally format all the text on a page without having to specify the 'class' for each TD?

I tried to use the following but they don't seem to work:

body {

font-family: arial,verdana,sans-serif;
font-size: 12px;
color: #000000;
font-weight : normal;
}

I also tried

TD {

font-family: arial,verdana,sans-serif;
font-size: 12px;
color: #000000;
font-weight : normal;
}

and it wouldn't work either.

Currently i have to insert "class=text" in every TD in order to format the text.

Appreciate ya help - thanks!
Shock
arya

aryastark
Offline
Regular
Last seen: 16 years 27 weeks ago
Joined: 2004-07-22
Posts: 18
Points: 0

Universal text tag?

oops sorry, forgot to add that i'm linking to an external css file for each web page.

thanks!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 2 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Universal text tag?

Hi there,

Those selectors should work!

Sounds like their may be something else going on, can you paste the full CSS/HTML , it will help in tracking down the problem.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

aryastark
Offline
Regular
Last seen: 16 years 27 weeks ago
Joined: 2004-07-22
Posts: 18
Points: 0

Universal text tag?

Hi!
I have the following tags in my external css file:

<style type="text/css">
body {

font-family: arial,verdana,sans-serif;
font-size: 12px;
color: #000000;
font-weight : normal;
}

a
{
color: #000000;
font-weight: bold;
text-decoration: none;
}
a:hover
{
color: #339900;
font-weight: bold;
text-decoration: underline;
}

.text
{
font-family: arial,verdana,sans-serif;
font-size: 12px;
color: #000000;
font-weight : normal;
}

.textlink
{
font-family: arial,verdana,sans-serif;
font-size: 12px;
color: #339900;
font-weight : Bold;
text-decoration: underline;
}

.textlink:hover
{
font-family: arial,verdana,sans-serif;
font-size: 12px;
color: #1F5B00;
font-weight : Bold;
text-decoration: underline;
}

.navheader
{
font-family: arial,verdana,sans;
font-size: 11px;
font-color: #000000;
font-weight: Bold;
}

.nav
{
font-family: arial,verdana,sans;
font-size: 10px;
font-color: #000000;
font-weight: Normal;
}

.nav:a
{
font-family: arial,verdana,sans;
font-size: 10px;
font-color: #000000;
font-weight: Normal;
}

.nav:hover
{
font-family: arial,verdana,sans;
font-size: 10px;
font-color: #339900;
font-weight: Normal;
}

.textsm
{
font-family: arial,verdana,sans;
font-size: 10px;
font-color: #000000;
font-weight: Normal;
}

.sidelinks
{
font-family: arial,verdana,sans;
font-size: 11px;
font-color: #000000;
font-weight: Bold;
text-decoration: none;
}

.sidelinks:a
{
font-family: arial,verdana,sans;
font-size: 11px;
font-color: #339900;
font-weight: Bold;
text-decoration: underline;
}

.sidelinks:hover
{
font-family: arial,verdana,sans;
font-size: 11px;
font-color: #1F5B00;
font-weight: Bold;
text-decoration: underline;
}

.click
{
font-family: arial,verdana,sans;
font-size: 11px;
font-color: #339900;
font-weight: Bold;
text-decoration: underline;
}

.click
{
font-size: 11px;
color: #339900;
font-family: arial,verdana,sans;
text-decoration: underline;
}

.click:a
{
font-size: 11px;
color: #339900;
font-family: arial,verdana,sans;
text-decoration: underline;
}

.click:hover
{
font-size: 11px;
color: #1F5B00;
font-family: arial,verdana,sans;
text-decoration: underline;
}

.print
{
font-size: 10px;
color: #000000;
font-family: arial,verdana,sans;
}

.footer
{
font-size: 9px;
color: #000000;
font-family: arial,verdana,sans;
}

.anchor
{
font-size: 10px;
color: #339900;
font-family: arial,verdana,sans;
text-decoration: underline;
}

.anchor:a
{
font-size: 10px;
color: #339900;
font-family: arial,verdana,sans;
text-decoration: underline;
}

.anchor:hover
{
font-size: 10px;
color: #1F5B00;
font-family: arial,verdana,sans;
text-decoration: underline;
}

a.normal
{
color: #000000;
font-weight: normal;
text-decoration: underline;
}
a.normal:hover
{
color: #1F5B00;
font-weight: normal;
text-decoration: underline;
}

</style>

===================

I was hoping the 'body' tag will take care of all the text on the website but it doesn't seem to work. Now i have to specify each TD of text with another font tag in order to format it.

I must have gotten the order wrong somewhere?

arya

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 2 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Universal text tag?

There are a number of things wrong,
you still have the embeded start tag <style type> you don't have that in an external sheet .

Your trying to use <a> anchor as a psuedo class in this way nav:a it is a full selector you would write .nav a {} if you wanted styles on the nav anchors

The use of sans is wrong should be sans-serif.

correct those and be carefull that you are not doubling up on properties that will inherit; try and keep the code as clean as possible.

See if any of that helps and post back.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

aryastark
Offline
Regular
Last seen: 16 years 27 weeks ago
Joined: 2004-07-22
Posts: 18
Points: 0

Universal text tag?

alrite, will check n clean up the tags - must admit it's really messy :oops:

so i should set the anchor tag as follows?

.anchor a {}

how about the hover tag for it?

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 44 weeks 4 days ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Universal text tag?

You would use

.anchor a:hover {}

Also, you have the class .click in there twice.

Verschwindende wrote:
  • CSS doesn't make pies