Solved

CSS & Tables

Posted on 1998-08-24
21
194 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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
 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
css, html 5 42
How to loop bootstrap columns which contain database records 9 37
Change Background Color of Website 5 16
Can't get container centered 4 12
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…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

786 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