CSS stylesheet with * attribute

Q

qbert

I am using this stylesheet :

* {font-family:verdana;font-size:15px}
#ta{font-size:30px;color:red}

With the #ta class i want to make my table's text look red and big.
<table id="ta">...

Bad thing: only the red color shows up, font-size stays as defined in
*
What am i doing wrong?
Thanks,
Karl
 
D

Dylan Parry

I am using this stylesheet :

* {font-family:verdana;font-size:15px}
#ta{font-size:30px;color:red}

With the #ta class i want to make my table's text look red and big.
<table id="ta">...

IIRC, some browsers (specifically IE) have problems with styles defined
for tables. You may find that changing "#ta" to "#ta td, #ta th" helps
as that specifically applies styles to the cells (and header cells)
within the table, not just the table itself.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
 
Q

qbert

for tables. You may find that changing "#ta" to "#ta td, #ta th" helps
as that specifically applies styles to the cells (and header cells)

Thanks!
This works.
 
C

Chris F.A. Johnson

I am using this stylesheet :

* {font-family:verdana;font-size:15px}
#ta{font-size:30px;color:red}

With the #ta class i want to make my table's text look red and big.
<table id="ta">...

Bad thing: only the red color shows up, font-size stays as defined in
*
What am i doing wrong?

You have set every element to 15px (which is the wrong way to do
it; use relative sizing), unless it is specifically changed.
Elements will not inherit font-size from the containing element.

Since you cannot use text directly in a <table> element, the 30px
will not affect anything. You need to apply the styling to the
cells that contain text, <td> and <th>.
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
I am using this stylesheet :

* {font-family:verdana;font-size:15px}
#ta{font-size:30px;color:red}

Sorry, but it's all wrong. Read a good tutorial on CSS _now_.

(All settings are wrong: using Verdana, setting font-size in pixels, and
setting color without setting background - and pure red is seldom a feasible
color for text.)
With the #ta class i want to make my table's text look red and big.

Stop wanting that.
<table id="ta">...

Bad thing: only the red color shows up, font-size stays as defined in
*

The "*" selector (not an attribute) selects all elements. So you are setting
font-size to 15px for all elements, including td elements (table cells). The
rule with #ta overrides this _only_ for the specific element (the table
element) that has id="ta". Setting font-size for a table does not directly
affect anything. It might affect elements inside the table via inheritance,
but here no inheritance of font-size takes place, since you have set
font-size for all elements.
 
M

mbstevens

dorayme said:
A web page on the "Galileo of Graphics" breaks out the red paint:

http://www.edwardtufte.com/tufte/

What a huge disappointment (but thanks for posting it).
His books actually have a lot of useful information.

But on that web page the 'Forum Topics' are hard to read
and should be bulleted, or at least separated by a
little space from each other, and the validator is having
a major Red Bull rage over the thing. I can only hope it's
more of a publisher thing over which that he didn't have sufficient
control.

As to the red links, I don't really have a huge objection, but
middle red is not the way to go. The red should be toned down
toward black a bit.
 
D

dorayme

mbstevens said:
What a huge disappointment (but thanks for posting it).
His books actually have a lot of useful information.

But on that web page the 'Forum Topics' are hard to read
and should be bulleted, or at least separated by a
little space from each other, and the validator is having
a major Red Bull rage over the thing. I can only hope it's
more of a publisher thing over which that he didn't have sufficient
control.

As to the red links, I don't really have a huge objection, but
middle red is not the way to go. The red should be toned down
toward black a bit.

I have no disagreement with any of this. I particularly agree
about the darker red being more appropriate for text if reddish
it is to be.
 
M

mbstevens

dorayme said:
I have no disagreement with any of this. I particularly agree
about the darker red being more appropriate for text if reddish
it is to be.
....at least if it's going to float on a white background, for contrast.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top