Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: CSS in Firefox

  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    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

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,739
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    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, &#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.


    .
    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

  • #4
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •