473,395 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can I remove the default font and color info from a TABLE?

I have a simple rule:

..main p { font-size: small; color: red;}

But if I put a paragraph in a TABLE, it basically comes out black and a
different size.

I found if I did:

..main table { font-size: small; color: red;}

then I got the right formatting.

Am I forced to tell the TABLE to, well, "get out of the way"? I tried:

..main table {font: none; color: none; }

but that didn't do anything.

Thanx!

Regards,

Will Hartung
May 16 '06 #1
7 1524
Will Hartung wrote:
I have a simple rule:

.main p { font-size: small; color: red;}

But if I put a paragraph in a TABLE, it basically comes out black and a
different size.
What odd tabular data you have, but you shouldn't see that effect
since "small" is an absolute value.

The three possibilities I can see (oh, this would be so much easier if you
provided URLs) are that:

(1) You are trying to put the text of the paragraph inside the table, then
the table inside the paragraph - which isn't possible as paragraph elements
cannot contain table elements. This is one of the times the validator
becomes a useful tool as it would complain about the end tag for the
paragraph being where it isn't allowed, and the parse tree view would show
the paragraph ending before the table opened.

(2) You have a selector more specific than ".main p" overriding your other
style. The Firefox DOM Inspector will show you which styles are being
applied to a given element, and in what order.
Am I forced to tell the TABLE to, well, "get out of the way"? I tried:
.main table {font: none; color: none; }
but that didn't do anything.


Which is unsurprising, you can't just make up syntax and expect it to work.

http://jigsaw.w3.org/css-validator/v...usermedium=all

However if you RTFM ...

http://www.w3.org/TR/CSS2/colors.html#colors

.... that the color property can take a color, or "inherit" as its value (and
something similar applies to the font property).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 16 '06 #2
Deciding to do something for the good of humanity, David Dorward
<do*****@yahoo.com> declared in
comp.infosystems.www.authoring.stylesheets:
The three possibilities I can see (oh, this would be so much easier if you
provided URLs) are that:

(1) You are trying to put the text of the paragraph inside the table, then <snip> (2) You have a selector more specific than ".main p" overriding your other
style.

<snip>

And number 3 is...? ;-)

--
Mark Parnell
My Usenet is improved; yours could be too:
http://blinkynet.net/comp/uip5.html
May 16 '06 #3
"Will Hartung" <re******@sbcglobal.net> wrote:
I have a simple rule:

.main p { font-size: small; color: red;}
And what is your URL? CSS alone does not do anything. It needs an HTML (or
XML) document to which it will be applied. Besides, the rule is very bad
practice on several accounts: setting font size to small for something that
is apparently copy text, setting color without setting background, and
setting color to red. Maybe it's "just an example", but do all examples need
to be bad examples?
But if I put a paragraph in a TABLE, it basically comes out black and a
different size.
Perhaps. This depends on the browser and its (hypothetical) default style
sheet. It also depends on the actual markup used as well as what your style
sheet as a whole really contains (as opposite to the potentially mistyped
extracts you've posted).
I tried:

.main table {font: none; color: none; }

but that didn't do anything.


Are you surprised? What did you expect? CSS isn't about inventing new
constructs and wishing they'll magically work. Otherwise we would all use
* { *: dwim; }
or something like that. What you probably meant was the special value
inherit (instead of none). It exists in the specs, but it's poorly
supported.

May 16 '06 #4
On Tue, 16 May 2006 07:56:05 +0200, David Dorward <do*****@yahoo.com>
wrote:
The three possibilities I can see [...] are that:

(1) [...]

(2) [...]


<intrigued />
--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
May 16 '06 #5
Barbara de Zoete wrote:
On Tue, 16 May 2006 07:56:05 +0200, David Dorward <do*****@yahoo.com>
wrote:
The three possibilities I can see [...] are that:

(1) [...]

(2) [...]


<intrigued />


Damnit - I thought I'd gone back an edited it back to two after deciding
that the third idea was impossible and not worth mentioning.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
May 16 '06 #6
On Tue, 16 May 2006 08:48:43 +0200, David Dorward <do*****@yahoo.com>
wrote:
Barbara de Zoete wrote:
On Tue, 16 May 2006 07:56:05 +0200, David Dorward <do*****@yahoo.com>
wrote:
The three possibilities I can see [...] are that:

(1) [...]

(2) [...]
<intrigued />


Damnit - I thought I'd gone back an edited it back to two


I know how that happens :-)
after deciding
that the third idea was impossible
Well, still intrigued. Maybe even more so than earlier, before you
responded :-)
and not worth mentioning.


Aww, pitty.

--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
May 16 '06 #7
Will Hartung wrote:
But if I put a paragraph in a TABLE, it basically comes out black and a
different size.


I think IE's quirks mode doesn't inherit styles into table cells properly.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

May 16 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: dmiller23462 | last post by:
Here is the code, it's not complete of course....I've been inserting lines as I go to pinpoint the issue.....I understand that the error message I'm getting (#185 Missing Default Property) is...
2
by: Isaac Grover | last post by:
Hi everyone, Rather than have this construct in my pages: <table> <tr><td><font face=arial size=3>line1</font></td></tr> <tr><td><font face=arial size=3>line2</font></td></tr> <tr><td><font...
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
2
by: Goober | last post by:
I have the following default.aspx page that works properly. However, what I want to do is to link the graphics within it (that are hard coded now in the default web page) to our corporate...
4
by: Chicagoboy27 | last post by:
All I am trying to find a solution for removing the ?returnUrl if a user is not authenticated. I want to be redirect an unauthenticated user to the login.aspx less the returnUrl. Once they log...
12
by: Doogie | last post by:
How do I make a value the default value for a combo box in ASP 3.0? What I have below does NOT work, yet I've seen it in HTML file examples before (and works if I put it in a HTML file by itself,...
31
by: Sarita | last post by:
Hello, this might sound stupid, but I got a really nice homepage template which unfortunately is a 3-Column Fixed Width CSS format. Now I don't have any content for the right column and would...
6
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
3
by: junkchiu | last post by:
want to remove "content" between two corresponding tags. What's the best way of doing it? I want to remove contents between <SEC-HEADER> and <table> tags. I have different tags, and I want to remove...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.