[DIV] Layout probleem MSIE/FF

Pagina: 1
Acties:

  • iznogood
  • Registratie: September 2001
  • Niet online
Het probleem is als volgt:

Ik ben bezig met een webpagina met dynamische content.Voor het uitlijnen van deze content maak ik gebruik van DIV's. Nu heb ik alles op papier uitgewerkt en de zaak in elkaar gedraait. Helaas werkt het zowel in IE als in FF niet:

Internet explorer:
Afbeeldingslocatie: http://members.chello.nl/~d.langeslag/ie.jpg

Firefox:
Afbeeldingslocatie: http://members.chello.nl/~d.langeslag/ff.jpg


Het CSS bestand:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    .head_cont{width:100%;clear:both;}
    .head_left{float:left; background:white;}
    .head_right{background:white;text-align:right;}

    .product_bar_left{margin-left:1px;margin-top:1px;float:left;width:60px;height:80px;border-style: solid; border-color:#000000; border-width:2px;}
    .product_bar_right{height: 84px;margin-left: 1px;margin-right;margin-top: 1px;}
    .product_bar_image{vertical-align:middle;width:60px;height:80px;}
    .product_bar_container{width:100%;}

    .detail_bar_left{text-align:center;margin-left:1px;margin-top:1px;width: 180px; height: 241px;float:left;}
    .detail_bar_right{height: 241;margin-left:1px;margin-top:1px;background-color:#cccccc;}
    .detail_bar_in{float:left;margin-left:0px;margin-top:210px;background-color:#cccccc;}
    .detail_bar_rb{text-align:right;float:right;margin-right:5px;margin-top:3px;width:100px;background-color:#cccccc;}
    .detail_bar_image{vertical-align:middle;width:180px;height:241px;}
    
    .general_layout_cont{width:100%;}
    .general_layout_left{float:left; width:200px;margin-top:1px;background-color:#cccccc;}
    .general_layout_right{margin-left:200px;}
    
    .catagory_links{color:black;text-decoration:none;}
    
    .price_normal{color:black;text-decoration:none;font-size:20px;}
    .price_offer {color:red;text-decoration:line-through;font-size:16px;}
    .price_normal_product_view{color:black;text-decoration:none;font-size:16px;}
    .price_offer_product_view {color:red;text-decoration:line-through;font-size:16px;}
    
    .top_line{float:left;width:100%;height:22px;margin-top:1px;background:black;clear:both;}
    .top_line_font{color:#ffffff; font-weight:bold;}
        
    .foot{float:left; width:100%;background:black;clear:both;margin-top:1px;text-align:right;}


De index pagina:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head>
    <?php
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-store, no-cache, must-revalidate");  
        header("Cache-Control: post-check=0, pre-check=0", false);
        header("Pragma: no-cache");
    ?>
    <link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/><title>Weapon Master - The Online weapon catalog</title></head>
<body>
    <div class="head_cont">
            <div class="head_left">[img]"_graphics/logo_left.jpg"/></div>
            <div[/img][img]"_graphics/logo_right.jpg"/></div>
    </div>  
    <div[/img]<font class="top_line_font">&nbsp;Catagories</font></div>
    <div class="general_layout_left"><br /><b><?php include"show_catagories.php"; ?></b></div>
    <div class="general_layout_right">
    <?php 
            if($action=="moreinfo")
            {
                include"moreinfo.php";
            } else
            {
                include"show_products.inc";
            } 
    ?></div>
    <div class="foot">[img]"_graphics/footer.jpg"/></div>
</body>
</html[/img]


Include"show_products.inc":
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
    $con=mysql_connect("127.0.0.1","root","") or die("could not connect to the database");
    $res=mysql_select_db("store");
    
    if($catag)
    {} else
    {
        $query="SELECT cat_name,product_id FROM catagories GROUP BY cat_name ASC";
        $result=mysql_query($query);
        $data=mysql_fetch_array($result);
        $catag=$data[cat_name];
    }
    
    
    if ($catag=="all_products") { $query="SELECT * FROM product order by product_name ASC"; }
    if ($catag=="all_offers")   { $query="SELECT * FROM product WHERE BIT_LENGTH(price_offer)>0 order by product_name ASC"; }

    if ($catag<>"all_products" AND $catag<>"all_offers"){ $query="SELECT * FROM catagories WHERE cat_name='".$catag."' ORDER BY product_id"; }
    
    $result=mysql_query($query);

    while($data=mysql_fetch_array($result))
    {
        if ($data[product_id]<>0)
        {
            $query="SELECT * FROM product WHERE product_id='".$data[product_id]."'";
            $result2=mysql_query($query);
            $data2=mysql_fetch_array($result2);
            
            if ($colu=="#CCCCCC") { $colu="#DDDDDD"; } else { $colu="#CCCCCC"; }    
            echo'<div class="product_bar_container">';
            echo'<div class="product_bar_left"  style="background-color: '.$colu.';">';
            echo'[img]"/sport/_shoppic/'.$data2[product_id].'.jpg?un='.time().'"[/img]</div>';
            echo'<div class="product_bar_right" style="background-color: '.$colu.';">';
            echo'<b>&nbsp;'.$data2[product_name];
            if ($data2[size])
            {
                echo " Size ".$data2[size]."</b>";
            } else
            {
                echo '</b>';
            }
            
            echo '<br/>&nbsp;'.$data2[product_descr_short].'<br/>';
            if($data2[price_offer])
            {
                echo'&nbsp;<font class="price_offer_product_view"> &euro; '.$data2[price].'</font> ';
                echo'&nbsp;<font class="price_normal_product_view"> &euro; '.$data2[price_offer].'</font><br/>';
            } else 
            {
                echo'&nbsp;<font class="price_normal_product_view"> &euro; '.$data2[price].'</font><br/>';
            }
            echo'&nbsp;<a href="index.php?action=moreinfo&product_id='.$data[product_id].'"><img src="_graphics/more_info.gif" width="97" 

height="21" border="0"/></a>[img]"_graphics/add_to_cart.gif"[/img]</div></div>';


        }
    }

?>


Excuus voor de lange code.. maar ik begrijp echt niet wat ik fout doe.

[ Voor 16% gewijzigd door iznogood op 27-07-2005 12:15 ]

Just as Good


  • crisp
  • Registratie: Februari 2000
  • Laatst online: 00:46

crisp

Devver

Pixelated

1) 3 pixel text-jog (bug in IE dus)
2) zet een clearing element onder je floats of geef de container waar de float in zit een vorm van overflow (hidden of auto).

Intentionally left blank


  • iznogood
  • Registratie: September 2001
  • Niet online
crisp schreef op woensdag 27 juli 2005 @ 12:19:
1) 3 pixel text-jog (bug in IE dus)
2) zet een clearing element onder je floats of geef de container waar de float in zit een vorm van overflow (hidden of auto).
Ok, thanks :) had er nog nooit van gehoord... als ik dat toepas zal de pagina iig in IE goed weergegeven worden. Any thoughts over het FF probleem ?

Just as Good


  • crisp
  • Registratie: Februari 2000
  • Laatst online: 00:46

crisp

Devver

Pixelated

iznogood schreef op woensdag 27 juli 2005 @ 12:37:
[...]

Ok, thanks :) had er nog nooit van gehoord... als ik dat toepas zal de pagina iig in IE goed weergegeven worden. Any thoughts over het FF probleem ?
ja, zie 2) ;)

Overigens is je markup niet je-van-het; het is een mix van smurfentaal (bijna alleen maar divs, geen semantiek) en tagsoup (font-elementen? no-breaking-spaces?). Verdiep je eens in selectors en zaken als padding en margin ;)

[ Voor 31% gewijzigd door crisp op 27-07-2005 12:40 ]

Intentionally left blank


  • Bosmonster
  • Registratie: Juni 2001
  • Laatst online: 01-05 19:54

Bosmonster

*zucht*

ander tipje

dit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.product_bar_left {
   margin-left: 1px;
   margin-top: 1px;
   float: left;
   width: 60px;
   height: 80px;
   border-style: solid; 
   border-color: #000000; 
   border-width: 2px;
}

.product_bar_right {
   height: 84px;
   margin-left: 1px;
   margin-right; /* hier zit nog een foutje dus kom je zo achter ;) */
   margin-top: 1px;
}

.product_bar_image {
   vertical-align: middle;
   width: 60px;
   height: 80px;
}

.product_bar_container {
   width: 100%;
}


is een stuk leesbaarder dan

code:
1
2
3
4
    .product_bar_left{margin-left:1px;margin-top:1px;float:left;width:60px;height:80px;border-style: solid; border-color:#000000; border-width:2px;}
    .product_bar_right{height: 84px;margin-left: 1px;margin-right;margin-top: 1px;}
    .product_bar_image{vertical-align:middle;width:60px;height:80px;}
    .product_bar_container{width:100%;}