Click to See Complete Forum and Search --> : Strange display issues with Firefox, and Internet Explorer 7
sonoftsadik
11-21-2007, 02:46 PM
Hi everyone!
I have been looking for a good web dev forum, and looks like I have found it!
I hope that you will be able to help me out today, and that I may be able to do the same for you sometime...
I am designing a Joomla template. This is the first one I have done. (Which may explain a lot ;P) I am using the JSAS(Joomla Stand Alone Server) to develop it before upload.
The layout is blog style with a dynamic header that changes based on the menu item selected. Then next is a menu that is a single image rollover using css. Then is the main body of the page, and footer.
Screen shot of site in IE7:http://img156.imageshack.us/my.php?image=11212007143401bt0.png
Screen shot of site in FF2:http://img129.imageshack.us/my.php?image=11212007143555uf2.png
As you see in IE7(6 does it too), it looks as if the menu is getting cutoff. I do have the overflow: hidden in the FF CSS code, but not in the IE specific CSS.
Now in Firefox, the menu seems to display to the right, and the more menu entries to test with, they disappear inside the page to the right with in the bounds of the container div.
sonoftsadik
11-21-2007, 03:05 PM
Had to break it up...
ie.css
@charset "utf-8";
/* CSS Document */
#menu_wrapper{
background-image : url(../images/menubg.jpg) repeat-x 0 0;
width : 100%;
height : 40px;
padding-top : 0px;
padding-left : 0px;
padding-right : 0px;
padding-bottom : 0px;
margin : 0px;
}
.moduletable #active_menu{
background-image : url(../images/menu1.jpg);
background-position : 0px;
background-repeat : no-repeat;
color : #D8F1FE;
display : inline-block;
text-decoration : none;
padding-left : 6px;
padding-right : 6px;
margin-bottom : 20px;
}
.moduletable #active_menu:hover{
background-image : url(../images/menu1.jpg);
background-position : -150px;
background-repeat : no-repeat;
color : #CCCCCC;
text-decoration : none;
padding-left : 6px;
padding-right : 6px;
margin-bottom : 20px;
}
.moduletable .mainlevel{
background-image : url(../images/menu1.jpg);
background-position : -150px;
background-repeat : no-repeat;
color : #FFFFFF;
display : inline-block;
text-decoration : none;
padding-left : 6px;
padding-right : 6px;
margin-bottom : 20px;
}
.moduletable .mainlevel:hover{
background-image : url(../images/menu1.jpg);
background-position : 0px;
background-repeat : no-repeat;
color : #CCCCCC;
text-decoration : none;
padding-left : 6px;
padding-right : 6px;
margin-bottom : 20px;
}
img{
behavior : url(../css/iepngfix.htc);
}
body, html {
margin : 0;
padding : 0;
}
template_css.css
body{
background : #000000;
margin : 0px;
padding : 0px;
background-image : url(../images/Background.png);
background-repeat : repeat-x;
}
body,td,th,div{
font-family : Tahoma, Helvetica, sans-serif;
font-size : 13px;
color : #444;
}
a{
color : #333;
text-decoration : none;
}
a:hover{
text-decoration : underline;
}
#outline{
width : 800px;
margin-top : 10px;
background : #FFFFFF;
overflow : hidden;
}
#top_container{
background : #333 url(../../js_thinking_jsas/images/main_top.png);
height : 250px;
}
#middle_container{
overflow : hidden;
}
#middle_container_inner{
width : 785px;
text-align : left;
}
#left{
width : 755px;
float : left;
padding : 20px 20px;
}
#right{
width : 190px;
float : left;
}
#bottomcontainer{
background : url(../images/main_bottom.gif);
height : 30px;
padding : 0px 25px;
}
#icons{
padding-left : 10px;
padding-top : 3px;
}
#bottomcontainer #icon{
float : left;
margin-right : 2px;
}
#bottomcontainer #copyright{
float : right;
padding-right : 10px;
color : #999999;
}
table.moduletable{
width : 180px;
margin-bottom : 10px;
}
table.moduletable th,
.sectiontableheader{
font-weight : bold;
letter-spacing : 1px;
border-bottom : 1px solid #666;
}
table.moduletable td{
padding-top : 10px;
}
table.moduletable td td{
padding-top : 0px;
}
.sectiontableentry1{
background:#e7e7e7;
}
.contentheading{
color : #333;
font-size : 24px;
text-decoration : none;
padding-bottom : 7px;
background : url(../../js_thinking_jsas/images/underline.jpg) repeat-x bottom;
}
.contentheading a{
color : #444;
text-decoration : none;
}
.componentheading{
color : #333;
font-size : 28px;
margin-bottom : 20px;
text-decoration : none;
}
.small,.createdate,.modifydate{
color : #999999;
font-size : 11px;
}
#header{
width : 800px;
height : 200px;
background-image : url(../images/header.jpg);
}
body#home #header{
background-image : url(../images/header.jpg);
}
body#aboutus #header{
background-image : url(../images/header-about.jpg)
}
body#contactus #header{
background-image : url(../images/header-contact.jpg)
}
body#products #header{
background-image : url(../images/header-products.jpg)
}
body#services #header{
background-image : url(../images/header-services.jpg)
}
body#licensedreamstream #header{
background-image : url(../images/header-license.jpg)
}
body#whitepapers #header{
background-image : url(../images/header-white.jpg)
}
body#blog #header{
background-image : url(../images/header-blog.jpg)
}
body#investorrelations #header{
background-image : url(../images/header-invest.jpg)
}
body#news #header{
background-image : url(../images/header-news.jpg)
}
#menu_wrapper{
background-image : url(../images/menubg.jpg);
background-repeat : repeat-x;
width : 100%;
height : 40px;
margin : 0px;
padding : 0px;
overflow : hidden;
}
.moduletable #active_menu{
background-image : url(../images/menu1.jpg);
background-position : 0px;
background-repeat : no-repeat;
color : #D8F1FE;
padding-top : 1em;
padding-bottom : 12px;
padding-left : 7px;
padding-right : 7px;
overflow : hidden;
display : inline-block;
text-decoration : none;
}
.moduletable #active_menu:hover{
background-image : url(../images/menu1.jpg);
background-position : -150px;
background-repeat : no-repeat;
color : #CCCCCC;
overflow : hidden;
text-decoration : none;
vertical-align : middle;
}
.moduletable .mainlevel{
background-image : url(../images/menu1.jpg);
background-position : -150px;
background-repeat : no-repeat;
color : #FFFFFF;
padding-top : 1em;
padding-bottom : 12px;
padding-left : 7px;
padding-right : 7px;
overflow : hidden;
display : inline-block;
text-decoration : none;
vertical-align : middle;
}
.moduletable .mainlevel:hover{
background-image : url(../images/menu1.jpg);
background-position : 0px;
background-repeat : no-repeat;
color : #CCCCCC;
padding-top : 1em;
padding-bottom : 12px;
padding-left : 7px;
padding-right : 7px;
overflow : hidden;
text-decoration : none;
vertical-align : middle;
}
#logo{
float : right;
padding : 15px;
}
index.php
<?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed." );$iso = split( '=', _ISO );echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php mosShowHead(); ?>
<meta http-equiv="Content-Type" content="text/html;><?php echo _ISO; ?>" />
<?php if ( $my->id ) { initEditor(); } ?>
<?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.css\" type=\"text/css\"/>" ; ?>
<?php echo "<!--[if IE]><link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/ie.css\" type=\"text/css\"/><![endif]-->" ; ?>
<?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon.ico\" />" ; ?>
</head>
<?php include_once ("templates/ds-info/template.php"); ?>
<body id="<?php echo getMenuName(); ?>">
<div align="center">
<div id="outline">
<div id="header">
<a href="http://www.dreamstreamstudio.com"><img id="logo" src="<?php echo $GLOBALS['mosConfig_live_site']?>/templates/ds-info/images/logo.png" border="0" /></a>
</div>
<div id="middle_container">
<div id="menu_wrapper">
<?php mosLoadModules ( 'top' ); ?>
</div>
<div id="middle_container_inner">
<div id="left">
<?php mosMainBody(); ?>
</div>
<div id="right">
</div>
</div>
</div>
<div id="bottomcontainer">
<div id="icons">
<div id="icon"><a href="http://www.apache.org"><img src="<?php echo $GLOBALS['mosConfig_live_site']?>/templates/<?php echo $GLOBALS['cur_template']?>/images/icons/button_apache.png" border="0" /></a></div>
<div id="icon"><a href="http://www.php.net"><img src="<?php echo $GLOBALS['mosConfig_live_site']?>/templates/<?php echo $GLOBALS['cur_template']?>/images/icons/button_php.png" border="0" /></a></div>
<div id="icon"><a href="http://www.mysql.com"><img src="<?php echo $GLOBALS['mosConfig_live_site']?>/templates/<?php echo $GLOBALS['cur_template']?>/images/icons/button_mysql.png" border="0" /></a></div>
<div id="icon"><a href="http://www.mozilla.org/products/firefox"><img src="<?php echo $GLOBALS['mosConfig_live_site']?>/templates/<?php echo $GLOBALS['cur_template']?>/images/icons/button_firefox.png" border="0" /></a></div>
<div id="copyright">Copyright © <?php echo date("Y"); ?> by <?php echo $GLOBALS['mosConfig_sitename']?>. All Rights Reserved.</div>
</div>
</div>
</div>
</div>
</body>
</html>
I am at a complete loss. I have tried negative margins, and a slew of other hacks.
HELP!
Thanks!
Kravvitz
11-21-2007, 03:20 PM
Welcome to DevShed, sonoftsadik. :)
We need to see the X/HTML code after the PHP has been processed. View the page source in your browser and copy and paste it here.
sonoftsadik
11-21-2007, 03:24 PM
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DreamStream, LLC - Home</title>
<meta name="description" content="Joomla - the dynamic portal engine and content management system" />
<meta name="keywords" content="Joomla, joomla" />
<meta name="Generator" content="Joomla! - Copyright (C) 2005 - 2006 Open Source Matters. All rights reserved." />
<meta name="robots" content="index, follow" />
<link rel="shortcut icon" href="http://localhost:85/Joomla/images/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html;>charset=iso-8859-1" />
<link rel="stylesheet" href="http://localhost:85/Joomla/templates/ds-info/css/template_css.css" type="text/css"/>
<!--[if IE]><link rel="stylesheet" href="http://localhost:85/Joomla/templates/ds-info/css/ie.css" type="text/css"/><![endif]-->
<link rel="shortcut icon" href="http://localhost:85/Joomla/images/favicon.ico" /></head>
<body id="home">
<div align="center">
<div id="outline">
<div id="header">
<a href="http://www.dreamstreamstudio.com"><img id="logo" src="http://localhost:85/Joomla/templates/ds-info/images/logo.png" border="0" /></a>
</div>
<div id="middle_container">
<div id="menu_wrapper">
<table cellpadding="0" cellspacing="0" class="moduletable">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="1"><tr><td nowrap="nowrap"><a href="http://localhost:85/Joomla/index.php?option=com_frontpage&Itemid=1" class="mainlevel" id="active_menu">Home</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=16&Itemid=31" class="mainlevel" >About Us</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=15&Itemid=30" class="mainlevel" >Investor Relations</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=section&id=1&Itemid=2" class="mainlevel" >News</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=blogsection&id=0&Itemid=9" class="mainlevel" >Blog</a><a href="http://localhost:85/Joomla/index.php?option=com_contact&Itemid=3" class="mainlevel" >Contact Us</a><a href="http://localhost:85/Joomla/index.php?option=com_search&Itemid=5" class="mainlevel" >Search</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=14&Itemid=29" class="mainlevel" >Services</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=18&Itemid=32" class="mainlevel" >White Papers</a><a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=17&Itemid=33" class="mainlevel" >Products</a></td></tr></table> </td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="moduletable">
<tr>
<th valign="top">
Newsflash </th>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
<div id="middle_container_inner">
<div id="left">
<table class="blog" cellpadding="0" cellspacing="0"><tr><td valign="top"><div> <table class="contentpaneopen">
<tr>
<td class="contentheading" width="100%">
Example News Item 1 </td>
</tr>
</table>
<table class="contentpaneopen">
<tr>
<td width="70%" align="left" valign="top" colspan="2">
<span class="small">
Written by Administrator </span>
</td>
</tr>
<tr>
<td valign="top" colspan="2" class="createdate">
Wednesday, 07 July 2004 </td>
</tr>
<tr>
<td valign="top" colspan="2">
<img src="http://localhost:85/Joomla/images/stories/food/coffee.jpg" width="150" height="112" style="float: left;" hspace="6" alt="Image" title="Image" border="0" />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. </td>
</tr>
<tr>
<td colspan="2" align="left" class="modifydate">
Last Updated ( Wednesday, 07 July 2004 )
</td>
</tr>
<tr>
<td align="left" colspan="2">
<a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=6&Itemid=1" class="readon">
Read more...</a>
</td>
</tr>
</table>
<span class="article_seperator"> </span>
</div></td></tr><tr><td valign="top"><table width="100%" cellpadding="0" cellspacing="0"><tr><td valign="top" width="50%"> <table class="contentpaneopen">
<tr>
<td class="contentheading" width="100%">
Welcome to Joomla! </td>
</tr>
</table>
<table class="contentpaneopen">
<tr>
<td width="70%" align="left" valign="top" colspan="2">
<span class="small">
Written by Web Master </span>
</td>
</tr>
<tr>
<td valign="top" colspan="2" class="createdate">
Saturday, 12 June 2004 </td>
</tr>
<tr>
<td valign="top" colspan="2">
If you've read anything at all about Content Management Systems (CMS), you'll probably know at least three things: CMS are the most exciting way to do business, CMS can be really, I mean <i>really</i>, complicated and lastly Portals are absolutely, outrageously, often <i>unaffordably</i> expensive. <br /><br /><div class="mosimage" style=" border-width: 1px; float: left; width: 120px;" align="center"><img src="http://localhost:85/Joomla/images/stories/asterisk.png" width="70" height="67" hspace="6" alt="Joomla! Logo" title="Joomla! Logo" border="0" /><div class="mosimage_caption" style="text-align: center;" align="center">Example Caption</div></div>Joomla! is set to change all that ... Joomla! is different from the normal models for portal software. For a start, it's not complicated. Joomla! has been developed for the masses. It's licensed under the GNU/GPL license, easy to install and administer and reliable. Joomla! doesn't even require the user or administrator of the system to know HTML to operate it once it's up and running. </td>
</tr>
<tr>
<td colspan="2" align="left" class="modifydate">
Last Updated ( Saturday, 12 June 2004 )
</td>
</tr>
<tr>
<td align="left" colspan="2">
<a href="http://localhost:85/Joomla/index.php?option=com_content&task=view&id=1&Itemid=1" class="readon">
Read more...</a>
</td>
</tr>
</table>
<span class="article_seperator"> </span>
</td></tr></table></td></tr></table> </div>
<div id="right">
</div>
</div>
</div>
<div id="bottomcontainer">
<div id="icons">
<div id="icon"><a href="http://www.apache.org"><img src="http://localhost:85/Joomla/templates/ds-info/images/icons/button_apache.png" border="0" /></a></div>
<div id="icon"><a href="http://www.php.net"><img src="http://localhost:85/Joomla/templates/ds-info/images/icons/button_php.png" border="0" /></a></div>
<div id="icon"><a href="http://www.mysql.com"><img src="http://localhost:85/Joomla/templates/ds-info/images/icons/button_mysql.png" border="0" /></a></div>
<div id="icon"><a href="http://www.mozilla.org/products/firefox"><img src="http://localhost:85/Joomla/templates/ds-info/images/icons/button_firefox.png" border="0" /></a></div>
<div id="copyright">Copyright © 2007 by DreamStream, LLC. All Rights Reserved.</div>
</div>
</div>
</div>
</div>
</body>
</html>
<!-- 1195680201 -->
Kravvitz
11-21-2007, 03:59 PM
One issue I notice is that you don't need to add all of the declarations to the rules in the IE stylesheet. You only need to use declarations where the value is different from the one in the regular stylesheet.
Another issue is that Firefox 2 doesn't support display:inline-block. I know a workaround, but you would need to make Joomla generate better markup first.
Have you read this? (http://dev.joomla.org/content/view/1136/79/1/3/)
sonoftsadik
11-21-2007, 04:32 PM
Thanks for the intro Kravvitz...
Your suggestion about cleaning up the Joomla markup, along with the article, has helped A TON! I put the parameter "-2" in the menu php code, and it now has only one table, versus like 4.
I now think I know what the problem was/is! IE renders a <td> with a blank line as an extra line.
Example
<table>
<tr>
<td>
</td>
</tr>
</table>
Thus with all the extra tables there was at least one empty <td>, thats where the padding was coming from.
Screen shot from IE now:http://img249.imageshack.us/my.php?image=11212007162912mq2.png
Screen shot from FF now:http://img219.imageshack.us/my.php?image=11212007162708hr6.png
I'm sure the rest will be easy...
Looks like IE needs some margin to the bottom.
Firefox looks like he will need some tweaking over all.
Any other suggestions are welcome!
Thanks Kravvitz!
drhowarddrfine
11-21-2007, 05:59 PM
Firefox rarely needs tweaking. Use it as your guide to how things work. Then see how IE screws it up and tweak IE, not Firefox.