html - css div issue in ff and ie -


<!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" xml:lang="en" lang="en"> <head>  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> hasvbar="";hashbar=""; $(document).ready(function() {     if ($(document).height() > $(window).height()) {        hasvbar="y";    }     if ($(document).width() > $(window).width()) {         hashbar="n";    }}); </script>  <script type="text/javascript"> <!-- cua=""; window.onload=function starterjobs(){ chkbrowser();setmidsecstart();}  // chk browser function chkbrowser(){ if(navigator.appname=="microsoft internet explorer") {cua="ie";} else {cua="oth";} } // ends chkbrowser()  // starting of body matter section function setmidsecstart(){ if(cua=="ie") { //document.getelementbyid('gdmatter').style.top='150px'; } else{}} // ends chkbrowser() --> </script>  <style type="text/css">         * {            border:                      0;         margin:                     0;         padding:                    0;         outline:                    none;     }     body {             background-color:           #5e0305;         font-family:                arial, helvetica, sans-serif;         font-size:                  12px;         color:                      #999;         line-height:                16px;         }          #gdtrunk {         background:transparent url(../images/mbb.png) repeat-x;      }      .wrapper {         width:                      1000px;         margin:                     0 auto;         }      #topbar {         background:                 transparent url(../images/mbb.png) repeat-x; /* menu bar base*/         height:                     62px;         overflow:                   visible;         position:                   relative;         z-index:                    3;     }      #topbar #itmlogo {         float:                      left;         list-style:                 none;                  }      #topbar #menutop {         float:                      right;         height:                     55px;         background-color:           transparent;     }      #topbar ul#menutop {         list-style:                 none;     }      #topbar ul#menutop li {         float:                      left;         text-align:                 right;     }     #topbar ul#menutop {         float:                      left;         display:                    block;         width:                      110px;         height:                     42px;         padding:                    14px 7px 0px 0px;         text-transform:             uppercase;         text-decoration:            none;         font-weight:                bold;         font-size:                  12px;         color:                      #000;         letter-spacing:             1px;     }  </style>  </head><body> <div id="gdtrunk" >   <div class="wrapper">     <div id="topbar" style="clear:both;"><a name="top"></a>       <div id="logobox">         <ul id="itmlogo">           <li><a href="http://www.e.com/"><img id="top-logo" src="./images/logo1.png" alt="elogo" title="e logo" width="180px"; height="198px;" /></a> </li>         </ul>           </div>       <div id="menubox">         <ul id="menutop">           <li>               <a onclick="getlink('home'); return false" href="./inmaking.html" onmouseover="status=''; return true;" >home</a>           </li>         </ul>       </div>     </div>  </div>  <div class="wrapper" >  <div id="gdmatter" style="background-color:#cccccc; position:relative; clear:both; top:10px; height:auto; padding:25px;padding-left:75px;"> <!-- graphic designing starts  --> <div style="background-color:transparent; position:relative; top:0px; left:0px; height:300px;overflow:hidden;">  <div style=" position:relative; top:0px; left:0px; background:transparent; width:auto; height:10px; padding:20px 0px 20px 0px;"> <div style="position:relative; top:0px; left:0px; background:transparent url(butsquare1.gif) no-repeat; width:10px; height:10px; border:white solid 1px;"></div> <div id="printing1" style="position:relative; top:-20px; left:25px; background-color:transparent; width:auto; height:20px; padding-top:5px; margin-right:25px;">graphic designing    </div> </div>  <div style="position:relative; top:0px; left:0px; background-color:transparent;" >     <div id="abtgd1" style="background-color:#897656; position:relative; top:0px; left:0px;z-index:5; padding:10px 25px 20px 25px; height:225px; margin-left:0px; color:#c4baaa" class="h1text1"> lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum.     </div> </div><!-- abtgd123 ends --> </div><!-- graphic designing ends--> </div> <!-- gdmatter --> </div><!-- wrapper 2nd closed--> </div><!-- gdtrunk --> </body></html> 

edited add link jsfiddle demo, linked-to op in comment @japanpro's answer.

this code actually

<div class="div1">     <div class="div2">         <div class="div3" style="height:62px;">             <img src="" style="height:200px;">         </div>         <div class="div4" style="clear:both">test</div>     </div> </div>​​​​​​​​ 

now question should how can same result in browser

<div class="div1">     <div class="div2">         <div class="div3">             <img src="" style="height:200px;display:block">         </div>         <div class="div4">test</div>     </div> </div>​​​​​​​​ 

using code give same result across browser.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -