CSS problems with FireFox

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

CSS problems with FireFox

Post by mjseaden »

Hi,

I have a normal, non-special CSS file which I include in my HTML file using the usual <link rel=...> method in the <head></head> tags. It works on IE (as do most things), however on FireFox it doesn't seem to pick up the CSS at all. I'm not sure why. Any ideas?

Many thanks

Mark
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

You should post this in the client side forum.

And about your question:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

  <title>MyTitle</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <link rel="stylesheet" type="text/css" media="screen" href="css/screen.css"/>
</head>

<body>
..
works in all modern browsers.
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post by mjseaden »

what's wrong with this

Code: Select all

<style type="text/css">
	body
	{
		background-color:#ffffff;
	}
	
	table
	{
	    border: 0px;
	    border-collapse: collapse;
	    cell-spacing:0px;
	    padding: 0px;
	    margin:0px;
	}
	
	form
	{
		border:0px;
		padding:0px;
		margin:0px;
	}
	
	input
	{
		font-size:9pt;
	}

	select
	{
		font-size:9pt;
	}
	
	table.wrksp
	{
		vertical-align:top;
	}
	
	table.menu
	{
		border:0px;
		border-collapse: collapse;
		cell-spacing:0px;
		padding: 0px;
		margin:0px;
		width:100%;
	}
	
	td.ds
	{
		background-color:#ddddff;
		border-right: 2px solid #bbbbbb;
		padding-right:2px;
		margin: 0px;
	}
	
	td.ls
	{
	    background-color:#eeeeff;
	   	border-right: 2px solid #bbbbbb;
	    border: 0px;
	    padding-right:2px;
	    margin: 0px;
	}
	
	td.header
	{
		background-color:#ffffff;
		border-bottom: 1px solid #1f78cd;
		border-spacing:0px;
		margin:0px;
		padding:3px;
		width:100%;
		height:50px;
		vertical-align:middle;
	}

	td.headerlogo
	{
		background-color:#ffffff;
		border-bottom: 1px solid #1f78cd;
		border-spacing:0px
		margin:0px;
		padding:3px;
		width:120px;
		height:50px;
		vertical-align:middle;
	}
	
	td.wrkspmenu
	{
		padding-top:20px;
		padding-right:30px;
		padding-left:15px;
	    background-color:#ffffff;
	    height:100%;
	    width:30%;
	    vertical-align:top;
	}
	
	td.wrkspdisplay
	{
		height:100%;
		width:70%;
		padding-top:35px;
	}
	
	td.wrksptitle
	{
		background-color:#1f78cd;
		height:15px;
		width:200px;
	}
	
	td.wrkspbutton
	{
		background-color:#ddddff;
		height:15px;
		border:1px solid #1f78cd;
		width:200px;
	}
	
	td.tabletitle
	{
		background-color:#1f78cd;
		height:30px;
	}
	
	a.wrkspbutton
	{
		font-family: sans-serif;
		color: #000000;
		font-size:9pt;
		text-decoration:none;
	}
	
	a.wrkspbutton:hover
	{
		font-family: sans-serif;
		font-weight: bold;
		color: #ff0000;
		font-size:9pt;
		text-decoration:none;
	}
	
	font
	{
		font-family: sans-serif;
		color: #000000;
		font-size:9pt;
	}
	
	font.large
	{
		font-family: sans-serif;
		font-weight: bold;
		color: #000000;
		font-size:12pt;
	}

	font.wrksptitle
	{
		font-family: tahoma,sans-serif,arial;
	    font-size:9pt;
	    font-style:bold;
	    color:#ffffff;
	}

	font.wrkspbutton
	{
		font-family: tahoma,sans-serif,arial;
	    font-size:9pt;
	    color:#000000;
	}
	
	font.tabletitle
	{
		font-family: tahoma,sans-serif,arial;
		font-size:9pt;
		color:#ffffff;
		font-weight:bold;
	}
	
	input.norm
	{
		font-size:9pt;
	}

</style>
This is prs.css which is included via the <link rel..> method. It doesn't seem to work on FireFox, but works fine on IE.

Many thanks

Mark
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: CSS problems with FireFox

Post by Roja »

mjseaden wrote:Hi,

I have a normal, non-special CSS file which I include in my HTML file using the usual <link rel=...> method in the <head></head> tags. It works on IE (as do most things), however on FireFox it doesn't seem to pick up the CSS at all. I'm not sure why. Any ideas?

Many thanks

Mark
Share the html code that doesn't work.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Get rid of the

Code: Select all

<style type="text/css"> </style>
in the stylesheet. You don't need those when you link to it.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Client-Side.
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post by mjseaden »

The <head> tags are not showing in "View->Page Source", but they are in IE visible, but with no <html> tag at the beginning. I'm sending these HTML headers:

Code: Select all

HTTP/1.0 200 OK
Content-type: text/html"
Followed by the <html> opening tag, which as just mentioned is not showing in either IE or FireFox.

However, the code for the page I am currently typing into is showing. The question is, what's causing the specific problem here? The fact that I'm doing direct CGI stdout sending of HTML headers and HTML code (I'm programming in Visual C++/MFC and running through CGI) might be something to do with it....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the content-type should be text/css and it shouldn't have those html tags..
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post by mjseaden »

Got it...I didn't have a blank line between my HTTP headers and the <html> tag, which for some reason caused IE to ignore the html tag but do it anyway, and for FireFox to completely ignore the <html><head></head> tags.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Mark, would you like to post your code next time or explain the problem some more? That would have saved me some time trying to help you. Thanks.
Post Reply