Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

css not working in firefox

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi folks,
I have the following html page where the style is not working on firefox browser, but works in IE. I tried the varies ways of including the css, but the style just doesn't show up. the css file and the html file are both in the same directory.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<LINK href="/Top.css" rel="stylesheet" type="text/css">
<LINK href="./Top.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
@import url("./Top.css");
-->
</style>
</head>

<body>
<table width="600" class="topnavtable">
<!--DWLayoutTable-->
<tr>
<Td class="regNavCell">
hello xy z
</Td>


</tr>

</table>

</body>
</html>


Top.css

.topnavtable{

border-width:1px;
border-color: #3c5f84;
border-style:solid;
background-color: #DAECFF;
text-align: center;
color:#0080c0;
font-weight: bold;
border-left-width:0px;
}

td.regNavCell{
color:#FF0000;
white-space: nowrap;
background-color: #DAECFF;

}
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try



?

That should work in a straight HTML environment when the files are in the same folder.
[ October 11, 2005: Message edited by: Bear Bibeault ]
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I did try Top.jsp, it didn't work
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well. if it's working in IE, it's unlikely to be the URL in any case.

Pare it down to one link tag that works in IE and make some simple style rules, such as changing the body background, to ensure that it isn't "taking" in Firefox. I've never had such issues.
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just cut and pasted your code, replacing the link tags and style section with just:



and it worked perfectly for me in Firefox 1.0.6.

This isn't in a J2EE web app or anything like that?
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks all, I found what my problem is. In my Top.css the first style i have is something like this
#top-Table table{
{

COLOR: gray;
font-size:1.0em;


}


and this breaks rest of the stylesheet for firefox. I am wondering does firefox not allow this kind of notation??
thanks
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also tried some css syntax related to id from
http://www.w3schools.com/css/css_syntax.asp, and they break rest of the css in firefox...

tried
p#green{
{

}
div#mydiv{
}
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I copied your examples verbatim and they worked fine for me.
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok here are they verbatim:
untitle.html:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<LINK href="Top.css" rel="stylesheet" type="text/css">


</head>

<body>
<table width="600" class="topnavtable">
<!--DWLayoutTable-->
<tr>
<Td >
hello xy z
</Td>
<td>

</td>

</tr>

</table>

</body>
</html>



Top.css:


p#green{
{

COLOR: gray;

font-size:1.0em;


}
.topnavtable{

border-width:10px;
border-color: #3c5f84;
border-style:solid;
background-color: #DAECFF;
text-align: center;
color:#0080c0;
font-weight: bold;

}





they style does not show up on my firefox, however, if I switch the two styles around, then it works because the p#green style block breaks the syntax. If they work for you as provided above, I guess something is really wrong with my firefox.
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well of course it's not going to work if it's full of errors. Remove the extra brace, and change COLOR to the proper case.
 
Danger, 10,000 volts, very electic .... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic