Avatar billede kjetilh Nybegynder
25. september 2003 - 13:15 Der er 1 løsning

Layout problemer med I.E 5.0

Følgende ser korrekt ut i opera 7.0 og I.E 6.0, men når jeg ser på siden med I.E 5.0 "Main Box" mye bredere enn "Top Banner". Noen som kan se hvorfor dette ikke virker i I.E 5.0??

Siden kan sees her:
http://www.lilacsky.com/test.html

Og her er kildekoden:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
.content {
    position:relative;
    width:auto;
    min-width:120px;
    margin:9px 0px 9px 170px;
    border:1px solid black;
    background-color:white;
    padding:10px;
    z-index:3;
    }

#navAlpha {
    position:absolute;
    width:135px;
    top:81px;
    left:10px;
    border:1px solid black;
    background-color:white;
    padding:10px;
    z-index:2;

/* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
declaration. The incorrect IE5/Win value is above, while the correct value is
below. See http://glish.com/css/hacks.asp for details. */
    voice-family: "\"}\"";
    voice-family:inherit;
    width:135px;
    }
/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
length values to user agents that exhibit the parsing error exploited above yet get
the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
body>#navAlpha {width:135px;}
       
    #banner {
        background:#fff;
        height:40px;
        border-top:1px solid #000;
        border-right:1px solid #000;
        border-left:1px solid #000;
        border-bottom:1px solid #000;
        voice-family: "\"}\"";
        voice-family: inherit;
        height:39px;
    }
</style>   
</head>
<body>
<div id="banner"><h1>Top Banner</h1></div>

<div id="navAlpha"><table width='100%'>
<th>::Menu::</th>
<tr><td>Menu Item 1<br>Menu Item 2</td></tr>
</table></div>

<div class="content">
<table width='100%'>
<th>::Main Box::</th>
<tr><td>This is the main box content</td></tr>
</table></div> 
</body>
</html>
Avatar billede kjetilh Nybegynder
26. september 2003 - 11:10 #1
har funnet en løsning selv.

Problemet var med table.width og I.E 5.0
La inn en class .table

.table {
  width: 100% - 170px;
       
  voice-family: "\"}\"";
  voice-family: inherit;
  width: 100%;
  }
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester

Seneste spørgsmål Seneste aktivitet
I går 21:00 Libre Office Impress Af Frank i Andre styresystemer
I går 11:47 VB script Af Jenshentze i Word
I går 11:21 Popup ved opstart Af mort1 i Windows
04/0918:50 Slet lokal konto Af ErikHg i Windows
04/0916:05 Ændre tal i en celle Af xvid i Excel