...

View Full Version : CSS in Firefox



kanbun
02-24-2011, 02:48 AM
This (http://survey.mcbcorp.net) looks correct in IE, but not in Firefox. Here's the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Test File</title>

<style type="text/css">
td#blocks { padding:0em 0em; height:inherit; width:100%; text-align:center;vertical-align:top;}
#col0 { display:inline; padding:3em; background-color:#9999CC; }

#col1 { display:inline; padding-top:2em;padding-left:2em; padding-right:2em;width:350px; height:inherit;background-color:transparent; vertical-align:top;text-align:center;font-family:cursive; font-size:20px;line-height:22px;}
#col1a { display:inline; padding:3em; width:350px; height:inherit;background-color:transparent; text-align:center;font-family:cursive; font-size:16px;}

#col2 { display:inline; padding-top:2em;padding-left:2em; padding-right:2em;width:350px; height:inherit; background-color:transparent; vertical-align:top;text-align:center; font-family:cursive; font-size:20px; line-height:22px;}
#col2a { display:inline; padding:3em; width:350px; height:inherit;background-color:transparent;text-align:center; font-family:cursive; font-size:16px;}

p.text1 {font-family: cursive; font-size: 14px; font-color:black; text-align: justify; margin-top:5;}
</style>
</head>

<body bgcolor="cccccc">
<table width="770" height="488" border="0" cellpadding="0" align="center" background="opennotebook.jpg">

<!-- Row 1 -->
<tr>
<td id="blocks">
<div id="col1">Test File Corporation
<p class="text1">A b c d e f g h i j k l m n o p q r s t u v w x y z.

<br><br>A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t u v w x y z</p></div>

<div id="col2">Test File Here
<p class="text1">A b c d e f g h i j k l m n o p q r s t u v w x y z

<br><br>A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t u v w x y z
<br><br>A b c d e f g h i j k l m n o p q r s t u v w x y zA b c d e f g h i j k l m n o p q r s t u v w x y z</p></div>

</td>
</tr>
</table>
</body>
</html>

Can someone tell me why this isn't working correctly in Firefox?

Thanks.

xelawho
02-24-2011, 05:18 AM
you have errors in your css:

http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fsurvey.mcbcorp.net%2F&profile=css21&usermedium=all&warning=1&vextwarning=&lang=en

(and in your html, too)

maybe fixing those will help

Excavator
02-24-2011, 09:13 AM
Hello kanbun,
Instead of tables and inline styles, try it using div elements and CSS instead.
Something like this to start with maybe -

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
margin: 0;
background: #FC6;
font: 100% cursive;
color: #333;
}
#container {
height: 488px;
width: 770px;
margin: 30px auto;
overflow: auto;
background: url(http://survey.mcbcorp.net/opennotebook.jpg);
}
#left {
height: 430px;
width: 280px;
margin: 30px 0 0 70px;
float: left;
}
#right {
height: 430px;
width: 280px;
margin: 30px 0 0 420px;
}
h1 {
font-size: 1em;
text-align: center;
}
p.text1 {font-size: 0.7em}
</style>
</head>
<body>
<div id="container">
<div id="left">
<h1>Test File Corporation</h1>
<p class="text1">
A b c d e f g h i j k l m n o p q r s t u v w x y z.
<br /><br />
A b c d e f g h i j k l m n o p q r s t u v w x y z A b c d e
f g h i j k l m n o p q r s t u v w x y z A b c d e f g h i j
k l m n o p q r s t u v w x y z A b c d e f g h i j k l m n o
p q r s t u v w x y z A b c d e f g h i j k l m n o p q r s t
u v w x y z
</p>
<!--end left--></div>
<div id="right">
<h1>Test File Here</h1>
<p class="text1">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<!--end right--></div>
<!--end container--></div>
</body>
</html>

When posting code in the forum, please use the code tags, &#91;code&#93;&#91;/code&#93; - available with the # button in the post edit window.
This will wrap your code in a scroll box which greatly helps the readability of your post.


.

kanbun
02-24-2011, 12:52 PM
Thanks Excavator. That works great. I was pretty sure my problem was not enough css, just not good enough to come up with the complete package.

This taught me a lot.

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum