Computing.Net > Forums > Web Development > CSS font for Firefox

CSS font for Firefox

Reply to Message Icon

Original Message
Name: liliyaw
Date: November 15, 2005 at 15:38:44 Pacific
Subject: CSS font for Firefox
OS: XP
CPU/Ram: 220
Comment:

Hello,
I made several web pages and formated the font in a .css file. The pages look nice in a IE browser, but in Firefox the font does not get formated prorerly -as if there was no .css file at all. Does anybody know what's happening?


Report Offensive Message For Removal

Response Number 1
Name: Laler
Date: November 15, 2005 at 17:51:27 Pacific
Subject: CSS font for Firefox
Reply: (edit)

Give us some sample code.

---
Site of the Day


Report Offensive Follow Up For Removal

Response Number 2
Name: liliyaw
Date: November 15, 2005 at 17:59:14 Pacific
Subject: CSS font for Firefox
Reply: (edit)

Here is my global.css and an .hmtl file.

My global.css
BODY
{
b { font-family: Verdana;}
span { font-family: Verdana; font-weight: bold; font-size: .6em; color: white}
.name { color: black}
.dim { color: darkgray}
.blue { color: navy}
.maroon {color: maroon}
.title { font-size: .7em; color: black}
.header { font-size: .8em}
}

And My BSSExecutionStatus.html page:

<HTML>
<HEAD>
<TITLE>BSS Execution Status</TITLE>
<link rel="stylesheet" type="text/css" href="stylesheets/global.css" >

<script language="JavaScript">

function wopen1() { window.open("?.html")}

</script>

</HEAD>
<BODY>
<center>

<table border = "1" bgcolor = "#808080">
<tr>
<td>

<table width="650" height="20" border = "1" bgcolor = "#808080">
<tr><td width="750" height="20" bgcolor = "navy">
<span class="header">BSS Execution Status</span>
</td></tr>
</table>

<table width="650" height="20" border = "0" bgcolor = "#FFFFFF">
<tr>
<td width="100"></td>

<td>
<span class="blue">Timer Cnt </span>
<input span class="blue" name = "timer" type = "text"
size = "1" value = "0" >
</td><td>
<span class="blue">TimeOut Count </span>
<input span class="blue" name = "timeout" type = "text"
size = "1" Value = "7">
</td></tr>
</table>

<table width="650" border = "0" bgcolor = "#FFFFFF">
<tr>
<td width="300">
<table width="280" height="50" border = "0" bgcolor = "#62ADE7">
<tr><td><center>
<span class="name">CONFIG: Olympic</span></td></tr>
<tr><td><center>
<span class="name">CASE: Current</span></td></tr>
</table>

<table width="280" border = "0" bgcolor = "#514370">
<tr><td><center>
<span>LAUNCH TIME: Olympic</span></td>
<td>
<input span class="blue" name = "launchtime" type = "text"
size = "" Value = "10/12/2005 3:01:31 PM">
</td>
</tr>
<tr><td><center>
<span>PROCESS TIME:</span></td>
<td>
<input span class="blue" name = "processtime" type = "text"
size = "" Value = "0:05:41">
</td>
</tr>

<tr><td><center>
<span>BSS START TIME:</span></td>
<td>
<input span class="blue" name = "processtime" type = "text"
size = "" Value = "10/5/2005 7:16:00 PM">
</td>
</tr>
<tr><td><center>
<span>BSS END TIME:</span></td>
<td>
<input span class="blue" name = "processtime" type = "text"
size = "" Value = "10/31/2005 10:16:00 PM">
</td>
</tr>
<tr><td><center>
<span>PROCESS STEP:</span></td>
<td>
<input span class="blue" name = "processtime" type = "text"
size = "" Value = "Done">
</td>
</tr>
<tr><td><center>
<span>PERCENT DONE:</span></td>
<td>
<input span class="blue" name = "processtime" type = "text"
size = "" Value = "100">
</td>
</tr>
<tr><td><center>
<span>BSS VERSION NBR:</span></td>
<td>
<input span class="blue" name = "processtime" type = "text"
size = "" Value = "1.12.2">
</td>
</tr>
</table>

<table width="280" border = "0" bgcolor = "#62ADE7">
<tr><td><center>
<input span class="name" type = "button" size = ""
Value = "Display Error Report" onclick = "f()">

</td></tr>
<tr><td><center>
<input span class="name" type = "button" size = ""
Value = " Print Error Report " onclick = "f()">
</td></tr>
<tr><td><center>
<input span class="maroon" type = "button" size = ""
Value = " Stop Simulation " onclick = "f()">
</td></tr>
</table>


</td>

<td width="350">

<table width="350" height="50" border = "0" bgcolor = "#2C7722">
<tr><td>
<span class="header">BSS Process Complete</span>
</td></tr>
</table>


<table width="350" height="260" border = "0" bgcolor = "#2C7722">
<tr><td height="100">
<span class="header">
BSS Process Complete. Normal Completion.</span>
</td></tr>
<tr><td height="160"></td></tr>
</table>

</td>
</tr>
</table>

</td>
</tr>
</table>
</center>
</BODY>
</HTML>

I'm so thankfull that you're taking a look at it.


Report Offensive Follow Up For Removal

Response Number 3
Name: Michael J (by mjdamato)
Date: November 15, 2005 at 22:40:00 Pacific
Subject: CSS font for Firefox
Reply: (edit)

I'm going to guess that there is a syntax problem in your code that is preventing the style sheet to load properly. IE is very forgivving (in fact, too forgiving) of errors in your code. Browsers such as FireFox and Netscape adhere to standards much more closely than IE.

I see in your code you have MANY opeing <center> tags, but no closing tags. And it appears you have tables that aren't properly closed either. Clean up your code and it will probably work. In fact, a good way to start is to just make a shell of a page that works witht he style sheet, then start adding code back in a little at a time until you find the problem area(s).


Report Offensive Follow Up For Removal

Response Number 4
Name: liliyaw
Date: November 16, 2005 at 13:06:02 Pacific
Subject: CSS font for Firefox
Reply: (edit)

Well, the table looks fine in Firefox - all the rows, all the data and all the layout is exactly where and how they should be. The only thing that is off is the font.
Are you saying that not closing the <center> tags messes up the font and nothing else? - because everything else looks the way it should.


Report Offensive Follow Up For Removal

Response Number 5
Name: Michael J (by mjdamato)
Date: November 16, 2005 at 15:18:04 Pacific
Subject: CSS font for Firefox
Reply: (edit)

Could be, why don't you make sure your code is correct anyway. There's no need to use CENTER tags within a table cell, just use the align=center attribute in the TD tag.

Anyway, in your style sheet change:

b { font-family: Verdana;}

To:

b,td { font-family: Verdana;}

And, now that I take a second look, there are other coding erros as well:

<input span class="maroon" type = "button" size = "" Value = " Stop Simulation " onclick = "f()">

Why are you putting a span within another tag?!?!?! Also, assigning properties to the span tag itself is rather odd. Kind of defeats the purpose of what it's used for.

Michael J


Report Offensive Follow Up For Removal


Response Number 6
Name: liliyaw
Date: November 16, 2005 at 17:27:30 Pacific
Subject: CSS font for Firefox
Reply: (edit)

Thanks so mutch! I'm going to apply your suggestions right now.


Report Offensive Follow Up For Removal

Response Number 7
Name: liliyaw
Date: November 16, 2005 at 18:02:58 Pacific
Subject: CSS font for Firefox
Reply: (edit)

I did remove <center> tags and tried replacing

b { font-family: Verdana;}

To:

b,td { font-family: Verdana;}

I realized that I could have:
td { font-family: Verdana;}

The changes made no difference.
I apply properties to span because I saw it done in a book and I'm not sure how else I could do the same thing with text. Also, the text on the button HAS to be red, so I tried adding span there as well - it works in IE. Is there any other way to change the text of buttons?


Report Offensive Follow Up For Removal

Response Number 8
Name: Michael J (by mjdamato)
Date: November 19, 2005 at 13:56:20 Pacific
Subject: CSS font for Firefox
Reply: (edit)

I've read many tutorials on CSS and never saw the SPAN tag used in that manner. You specified classes in some of your tags, but you never defined them. Also, the b,td might not be working because it is encompassed within BODY. I really think it would do you some good to look at a few tutorials on the web.

Basically, (in my opinion) you should do the following:

In your style sheet define the "base" styles using:

body,td {
style: value;
style: value;
}

and create classes that will deviate from the base style:

.name {
style: value;
style: value;
}

Then in your HTML all text within the body or td's will have the base style by default. But you can give them a different style by assigning them to a class:

[td]this will be base text[/td]
[td class=name]name class text[/td]

Michael J


Report Offensive Follow Up For Removal

Response Number 9
Name: liliyaw
Date: November 24, 2005 at 10:31:30 Pacific
Subject: CSS font for Firefox
Reply: (edit)

Thanks a bunch. My .css file is finally making some difference in FireFox browser. Thank you, thank you, thank you!


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: CSS font for Firefox

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software