Solved

CSS & Tables

Posted on 1998-08-24
21
190 Views
Last Modified: 2010-04-09
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?
0
Comment
Question by:stratari
  • 10
  • 6
  • 3
  • +2
21 Comments
 
LVL 12

Expert Comment

by:Otta
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
I'm sorry but even if I add font statments after the table, the problem remains.
0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
Can you post your code and CSS sheet?
0
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 

Expert Comment

by:mstafford
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 6

Expert Comment

by:ckayter
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 6

Expert Comment

by:ckayter
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 6

Expert Comment

by:ckayter
Comment Utility
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
 
LVL 3

Author Comment

by:stratari
Comment Utility
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
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
Can I post as an answer since mstaffrod hasn't responded?  Since I was "close".. Although, my idea worked...

0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
See comment below..

0
 
LVL 3

Author Comment

by:stratari
Comment Utility
OK MasseyM. I'll give you the points. But please submit THE answer not a comment :-)))
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 250 total points
Comment Utility
<STYLE>
BODYTEXT  {
          font-family: arial;
          etc...
          }

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

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

772 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

12 Experts available now in Live!

Get 1:1 Help Now