Solved

CSS & Tables

Posted on 1998-08-24
21
192 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
ID: 1836980
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
ID: 1836981
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
ID: 1836982
I'm sorry but even if I add font statments after the table, the problem remains.
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1836983
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
ID: 1836984
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
ID: 1836985
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
ID: 1836986
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
ID: 1836987
Can you post your code and CSS sheet?
0
 
LVL 3

Author Comment

by:stratari
ID: 1836988
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
ID: 1836989
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:ckayter
ID: 1836990
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
ID: 1836991
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
ID: 1836992
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
ID: 1836993
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
ID: 1836994
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
ID: 1836995
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
ID: 1836996
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
ID: 1836997
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
ID: 1836998
See comment below..

0
 
LVL 3

Author Comment

by:stratari
ID: 1836999
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
ID: 1837000
<STYLE>
BODYTEXT  {
          font-family: arial;
          etc...
          }

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

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

920 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

17 Experts available now in Live!

Get 1:1 Help Now