CSS & Tables

Hi
I use CSS in my site linking an external file to my pages. The problem is that if I declare a <td> style in that external style sheet to change the font to Arial, it works but all the body text that follows a table, change to Times... What's happening?
LVL 3
stratariAsked:
Who is Participating?
 
MasseyMCommented:
<STYLE>
BODYTEXT  {
          font-family: arial;
          etc...
          }

<A CLASS=BODYTEXT>
all your text here
</A>

0
 
OttaCommented:
Font-size and font-style changes are "reset" by each '</TD>'
in your document.  So, "after" the table, you need to select a font.
0
 
stratariAuthor Commented:
Yes, this is what is happening. I figured it out already. But can this be done without entering font statements in the code? It's body text after alla and body font is declared in the style sheet.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
stratariAuthor Commented:
I'm sorry but even if I add font statments after the table, the problem remains.
0
 
MasseyMCommented:
Otta is almost right... The text is actually still contained within the <FRAME> tags ?  If so, then the text is not in the <BODY> flow...

Simple solution... around all your text, use this:
<STYLE>
BODYTEXT  {
          font-family: arial;
          etc...
          }

<A CLASS=BODYTEXT>
all your text here
</A>

That should do it for you...

If not, please post your code to this thread... Thanks..
0
 
stratariAuthor Commented:
Maybe i didn't make my self clear. Sorry about the hustle.
I got a file named r_frame.css. It contains stuff like
body {  font-family: Arial, Helvetica, sans-serif;
      font-size: 10pt;
      font-style: normal;
      etc }
td {  font-family: Arial, Helvetica, sans-serif;
      font-size: 10pt;
      font-style: normal;
      etc }
I'm calling that file from within my pages using
<LINK REL="stylesheet" TYPE="text/css" HREF="r_frame.css">
No <FRAME> (????) tags and no <STYLE> definitions here.
I have body text on my page in  Arial, then a table again in Arial and then more body text but now it shows in Times! And this happens in just a few pages, not all!
That's my problem...
0
 
MasseyMCommented:
Are you closing all your tags?  Make sure you close all the TH, TD, TR, and TABLE tags... If you don't you will lose lose your formatting...

0
 
stratariAuthor Commented:
All tags are closed. I tested the page both in Netscape's Composer and DreamWeaver.
My pages are up & running but they are in greek so it won't help you viewing them....
0
 
MasseyMCommented:
Can you post your code and CSS sheet?
0
 
stratariAuthor Commented:
Take a look at
http://members.xoom.com/stratari
Click on the ICQ link then the fourth link

I checked my pages with MSIExplorer 4.01.  Odd..... It looks great! No Times!!!!
Netscape bug? (4.05 & 4.06.    4.5PR1 doesn't show any CSS that comes from linked external file....
0
 
mstaffordCommented:
My best recommendation would be to use a class or id for running arial in conjunction with the global commands.  Example:

td {font family: Arial, ...;}
p (or body) { font-family: Arial, ...;}
arial { font-family: Arial, ...;}

Sometimes browsers don't quite understand CSS yet.  The reason MSIE may is because it's so stupid that it just defaults back to the last command it can find.  You got lucky in this case.
0
 
ckayterCommented:
Excuse me, stratari, I just have to respond to mstafford's comment re: IE.

IE is NOT stupid. It is correctly interpreting the code that stratari included in his CSS file. Browsers ignore any HTML code they cannot understand... Ergo, Netscape is the browser that is ignorant.
0
 
stratariAuthor Commented:
Here is the deal. I resolved the problem by defining a Style Tag called .a_text and used it to change the text following the tables using <span class="a_text"> text </span>
I didn't get an Expert Notification eMail for  mstafford's comment. Too bad for me. It would save me a lot of time. MasseyM got the problem almost right but mstafford had the solution.
Anyway, the problem is solved although no one can tell wy Communicator can't tell if the text is bodytext or not (I didn't get any respond from Netscape or its official newsgroups)
So help me out on this: Who gets the points? I think mstafford deserves them.
Thank you all.

0
 
stratariAuthor Commented:
Here is the deal. I resolved the problem by defining a Style Tag called .a_text and used it to change the text following the tables using <span class="a_text"> text </span>
I didn't get an Expert Notification eMail for  mstafford's comment. Too bad for me. It would save me a lot of time. MasseyM got the problem almost right but mstafford had the solution.
Anyway, the problem is solved althoughno one can tell why Communicator can't tell if the text is bodytext or not (I didn't get any respond from Netscape or its official newsgroups)
So help me out on this: Who gets the points? I think mstafford deserves them.
Thank you all.

0
 
ckayterCommented:
mstafford did suggest using a class, but he didn't suggest using the <span> tag. You are free to award your points as you wish, but I don't think his answer was complete enough for 250 points.

You can negotiate this with him, but if I were the one who'd offered an idea which ultimately led to you finding your own solution, I'd probably suggest you reduce the points to 100 or so and give me an "A" (which means E-E will multiply points by 4). Again, it's up to you what you want to do here. I know that as an E-E expert, I'd say you are being a most gracious and generous questioner. We've all seen much harder questions considered to be worth much less by the users asking them...

Colleen

0
 
stratariAuthor Commented:
I've been an expert here at EE for almost a year until I didn't have time to do this. So, I know how bad it is to spent time on someone elses problem and don't get anything in return.
There are no easy questions for the one that asks. I had a problem and wanted badly its solution. Anyone who came up with something usefull deserves the points. The bad thing at EE is that (although advertised at times) I can't split the points and award 'em to two or more experts. And I don't know if I can decrease the points...
0
 
ckayterCommented:
You can reduce points when asked to accept/reject an answer. But if you've been here a year, then you can probably afford the points you originally offered.

Since you also answer questions, you do appreciate the time and effort and the fact that, indeed, there are no easy questions!

Furthermore, I agree that when the answer is "mission critical," you need a solution at any cost.

In consideration of all of the above, I believe that if you feel that mstafford's suggestion led you to the answer, then by all means, do award him the points.

Colleen



0
 
stratariAuthor Commented:
mstafford
Please submit an answer to be graded
Please use your AND my facts so that anyone that pays to see the answer to this questions has the full image
Thank you all
Stratos
0
 
MasseyMCommented:
Can I post as an answer since mstaffrod hasn't responded?  Since I was "close".. Although, my idea worked...

0
 
MasseyMCommented:
See comment below..

0
 
stratariAuthor Commented:
OK MasseyM. I'll give you the points. But please submit THE answer not a comment :-)))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.