Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-24-2011, 02:48 AM   PM User | #1
kanbun
New to the CF scene

 
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kanbun is an unknown quantity at this point
CSS in Firefox

This 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.
kanbun is offline   Reply With Quote
Old 02-24-2011, 05:18 AM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
you have errors in your css:

http://jigsaw.w3.org/css-validator/v...rning=&lang=en

(and in your html, too)

maybe fixing those will help
xelawho is offline   Reply With Quote
Old 02-24-2011, 09:13 AM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello kanbun,
Instead of tables and inline styles, try it using div elements and CSS instead.
Something like this to start with maybe -
Code:
<!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, [code][/code] - 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.


.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 02-24-2011, 12:52 PM   PM User | #4
kanbun
New to the CF scene

 
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kanbun is an unknown quantity at this point
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.
kanbun is offline   Reply With Quote
Reply

Bookmarks

Tags
need css help

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:40 AM.


Advertisement
Log in to turn off these ads.