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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Div's not sitting pretty...

    I'm having problems with DIV's and browser compatibility. I can get everything to line up in FF OR IE but not both. The one that is out of place is always "sidebar2". If anyone could help, I'd be much obliged.

    Code:
    <div id="container">
    <div id="header">
    <div class="c1">
    <p> </p>
    <p><input name="search" type="text" id="search" size="35" />  <input name="search_button" type="button" dir="ltr" lang="en" value="Search" xml:lang="en" />   </p>
    </div>
    <div class="c1" id="header1a"><img src="images/A.png" alt="Traveling4Health.com" width="15" height="57" /><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('together','','images/B1.png',1)"><img src="images/B.png" alt="Traveling4Health.com" name="together" width="29" height="57" border="0" id="together" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sun','','images/C1.png',1)"><img src="images/C.png" alt="Traveling4Health.com" name="sun" width="30" height="57" border="0" id="sun" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('fly','','images/D1.png',1)"><img src="images/D.png" alt="Traveling4Health.com" name="fly" width="29" height="57" border="0" id="fly" /></a><img src="images/E.png" alt="Traveling4Health.com" width="17" height="57" /></div>
    </div>
    <div id="header2">This area is for menu buttons.</div>
    <div id="sidebar1">
    <p><strong>Column One</strong></p>
    <ul>
    <li>Login button, or</li>
    <li>Username and password fields</li>
    <li>Register button</li>
    <li>Animated menu here or below the banner</li>
    </ul>
    <p> </p>
    </div>
    <div id="sidebar2">
    <div id="side1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('rx','','images/rx1.png',1)"><img src="images/rx.png" alt="Traveling4Health.com" name="rx" width="68" height="87" border="0" id="rx" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('tooth','','images/tooth1.png',1)"><img src="images/tooth.png" alt="Traveling4Health.com" name="tooth" width="60" height="87" border="0" id="tooth" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('med','','images/med1.png',1)"><img src="images/med.png" alt="Traveling4Health.com" name="med" width="75" height="87" border="0" id="med" /></a></div>
    <div id="side2"></div>
    </div>
    <div id="mainContent">
    <p> </p>
    <blockquote>
    <p><strong>Main Welcome</strong></p>
    <ul>
    <li>Possible Video Commercial?</li>
    <li>Flash Presentation?</li>
    <li>Audio?</li>
    <li>Could be split as welcome and featured advertiser?</li>
    </ul>
    <em>Lots of space here....</em>
    <ol>
    <li>How is this font size?
    <ul>
    <li><span class="style1">Can we get away with this size?</span></li>
    </ul>
    </li>
    <li>How are we for color coordination and choices?
    <ul>
    <li>Is this too soft? Too neutral?</li>
    </ul>
    </li>
    </ol>
    </blockquote>
    <!-- end #mainContent --></div>
    <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
    <div id="footer">
        &nbsp;<br /><br />
        <span class="style2">2008 Traveling4Health.com<a href="http://validator.w3.org/check?uri=referer"><img
            src="http://www.w3.org/Icons/valid-xhtml10-blue"
            alt="Valid XHTML 1.0 Transitional" height="31" width="88" border="0"/></a><a href="#" target="_blank" class="style1"> Privacy Policy</a><a href="#" target="_blank">Terms &amp; Conditions</a><a href="#" target="_blank">Contact Us</a><a href="#" target="_blank">Advertise</a><a href="http://validator.w3.org/check?uri=referer"><img
            src="http://www.w3.org/Icons/valid-css1"
            alt="Valid XHTML 1.0 Transitional" height="31" width="88" border="0"/></a><a href="http://www.genrelab.com" target="_blank">Genre Laboratories Design Group</a></span> 
          <!-- end #footer -->
    </div>
    <!-- end #container --></div>
    Thanks,
    @

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Post your CSS too. BTW, a link to your page would be more useful!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    Post your CSS too. BTW, a link to your page would be more useful!
    My apologies, here's the partial HMTL, the CSS, and the link.

    HTML:
    Code:
    <div id="container">
    <div id="header">
    <div class="c1">
    <p> </p>
    <p><input name="search" type="text" id="search" size="35" />  <input name="search_button" type="button" dir="ltr" lang="en" value="Search" xml:lang="en" />   </p>
    </div>
    <div class="c1" id="header1a"><img src="images/A.png" alt="Traveling4Health.com" width="15" height="57" /><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('together','','images/B1.png',1)"><img src="images/B.png" alt="Traveling4Health.com" name="together" width="29" height="57" border="0" id="together" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sun','','images/C1.png',1)"><img src="images/C.png" alt="Traveling4Health.com" name="sun" width="30" height="57" border="0" id="sun" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('fly','','images/D1.png',1)"><img src="images/D.png" alt="Traveling4Health.com" name="fly" width="29" height="57" border="0" id="fly" /></a><img src="images/E.png" alt="Traveling4Health.com" width="17" height="57" /></div>
    </div>
    <div id="header2">This area is for menu buttons.</div>
    <div id="sidebar1">
    <p><strong>Column One</strong></p>
    <ul>
    <li>Login button, or</li>
    <li>Username and password fields</li>
    <li>Register button</li>
    <li>Animated menu here or below the banner</li>
    </ul>
    <p> </p>
    </div>
    <div id="sidebar2">
    <div id="side1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('rx','','images/rx1.png',1)"><img src="images/rx.png" alt="Traveling4Health.com" name="rx" width="68" height="87" border="0" id="rx" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('tooth','','images/tooth1.png',1)"><img src="images/tooth.png" alt="Traveling4Health.com" name="tooth" width="60" height="87" border="0" id="tooth" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('med','','images/med1.png',1)"><img src="images/med.png" alt="Traveling4Health.com" name="med" width="75" height="87" border="0" id="med" /></a></div>
    <div id="side2"></div>
    </div>
    <div id="mainContent">
    <p> </p>
    <blockquote>
    <p><strong>Main Welcome</strong></p>
    <ul>
    <li>Possible Video Commercial?</li>
    <li>Flash Presentation?</li>
    <li>Audio?</li>
    <li>Could be split as welcome and featured advertiser?</li>
    </ul>
    <em>Lots of space here....</em>
    <ol>
    <li>How is this font size?
    <ul>
    <li><span class="style1">Can we get away with this size?</span></li>
    </ul>
    </li>
    <li>How are we for color coordination and choices?
    <ul>
    <li>Is this too soft? Too neutral?</li>
    </ul>
    </li>
    </ol>
    </blockquote>
    <!-- end #mainContent --></div>
    <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
    <div id="footer">
        &nbsp;<br /><br />
        <span class="style2">2008 Traveling4Health.com<a href="http://validator.w3.org/check?uri=referer"><img
            src="http://www.w3.org/Icons/valid-xhtml10-blue"
            alt="Valid XHTML 1.0 Transitional" height="31" width="88" border="0"/></a><a href="#" target="_blank" class="style1"> Privacy Policy</a><a href="#" target="_blank">Terms &amp; Conditions</a><a href="#" target="_blank">Contact Us</a><a href="#" target="_blank">Advertise</a><a href="http://validator.w3.org/check?uri=referer"><img
            src="http://www.w3.org/Icons/valid-css1"
            alt="Valid XHTML 1.0 Transitional" height="31" width="88" border="0"/></a><a href="http://www.genrelab.com" target="_blank">Genre Laboratories Design Group</a></span> 
          <!-- end #footer -->
    </div>
    <!-- end #container --></div>
    CSS:
    Code:
    @charset "utf-8";
    body  {
    	font: 100% Verdana, Arial, Helvetica, sans-serif;
    	background: #666666;
    	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    	color: #000000;
    }
    .thrColLiqHdr #container {
    	width: 924px;  /* this will create a container 80% of the browser width */
    	background: #FFFFFF;
    	text-align: left; /* this overrides the text-align: center on the body element. */
    	position: static;
    	height: 660px;
    } 
    .thrColLiqHdr #header {
    	height: 166px;
    	background-image: url(images/Traveling4Health1.png);
    	top: 0px;
    	position: relative;
    	background-repeat: no-repeat;
    } 
    .thrColLiqHdr #header h1 {	
    }
    .thrColLiqHdr #header1a {
    	height: 57px;
    	left: 804px;
    	top: 109px;
    	position: absolute;
    } 
    .thrColLiqHdr #header2 {
    	height: 20px;
    	position: relative;
    	background-color: #FFFF33;
    }
    /* Tips for sidebars:
    1. Since we are working in percentages, it's best not to use side padding on the sidebars. It will be added to the width for standards compliant browsers creating an unknown actual width. 
    2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColLiqHdr #sidebar1 p" rule.
    3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
    */
    .thrColLiqHdr #sidebar1 {
    	float: left; /* this element must precede in the source order any element you would like it be positioned next to */
    	width: 203px; /* top and bottom padding create visual space within this div  */
    	background-image: url(images/sidebar-1.png);
    	background-repeat: no-repeat;
    	height: 410px;
    	position: absolute;
    }
    .thrColLiqHdr #sidebar1 p, .thrColLiqHdr #sidebar1 h3, .thrColLiqHdr #sidebar2 p, .thrColLiqHdr #sidebar2 h3 {
    	font-size: 16px;
    	font-style: normal;
    }
    .thrColLiqHdr #sidebar2 {
    	float: right; /* this element must precede in the source order any element you would like it be positioned next to */
    	width: 203px; /* top and bottom padding create visual space within this div */
    	background-repeat: no-repeat;
    	position: relative;
    	height: 410px;
    	top: 0px;
    	clear: none;
    	padding-top: 9px;
    }
    .thrColLiqHdr #side1 {
    	width: 203px; /* top and bottom padding create visual space within this div */
    	background-image: url(images/sidebar-2.png);
    	background-repeat: no-repeat;
    	position: absolute;
    	height: 87px;
    	padding-top: 0px;
    }
    .thrColLiqHdr #side2 {
    	width: 203px; /* top and bottom padding create visual space within this div */
    	background-image: url(images/sidebar-2a.png);
    	background-repeat: no-repeat;
    	position: absolute;
    	height: 323px;
    	left: 0px;
    	top: 96px;
    }
    /* Tips for mainContent:
    1. the space between the mainContent and sidebars is created with the left and right margins on the mainContent div.
    2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 300px or smaller (this includes images).
    3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
    */
    .thrColLiqHdr #mainContent {
    	background-image: url(images/main_content.png);
    	background-repeat: no-repeat;
    	position: absolute;
    	margin-top: 0px;
    	margin-right: 203px;
    	margin-left: 203px;
    	height: 410px;
    }
    .thrColLiqHdr #footer {
    	background-image: url(images/Traveling4Health2.png);
    	background-repeat: no-repeat;
    	position: absolute;
    	margin-top: 419px;
    	height: 84px;
    	width: 924px;	
    } 
    .thrColLiqHdr #footer p {
    	font-size: 16px;
    	text-transform: none;
    	text-decoration: none;
    	line-height: 24px;
    }
    
    /* Miscellaneous classes for reuse */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    	float: right;
    	margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page The floated element must precede the element it should be next to on the page. */
    	float: left;
    	margin-right: 8px;
    }
    .MagnifImage {background-color:#fff; color:#00f; font-weight:bold; border:4px outset #ccc; text-align:center; padding:0;margin:0;
    }
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain its child floats */
    	clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    }
    LINK:
    www.sshuc.com/t4h

    Furthermore, if anyone can explain to me why it's centered in IE and not in FF, that would also be great. Thanks!

    - @

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Put margin:0pt auto; to your container.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    Put margin:0pt auto; to your container.
    Thanks. That centered it in FF, but the DIVs are still awry.

    - @


  •  

    Posting Permissions

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