Cytat(Kuziu @ 2006-04-03 14:59:10)
mike_mech robiłeś tak kiedyś ?
Pociąłem już wiele designów. Każdy zawsze dostawał alternatywne style dla badz
IEwia.
Przykład:<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" >
<head>
<style type="text/css">
html, body {
font: 11px Tahoma, Verdana, sans-serif;
}
div {
margin: auto;
}
div#siteContainer {
width: 500px;
padding: 10px 0 50px 0;
border: #f00 solid 1px;
}
div#width200 {
width: 200px;
height: 13px;
background-color: #f00;
text-align: center;
color: #fff;
}
div#width300 {
width: 300px;
height: 13px;
background-color: #00f;
text-align: center;
color: #fff;
}
div.spacer {
height: 10px;
}
div#box {
width: 200px;
height: 200px;
padding: 50px;
border: #f00 dashed 1px;
}
</style>
</head>
<body>
<div id="siteContainer">
<div id="width200">200px long</div>
<div id="width300">300px long</div>
<div class="spacer"></div>
<div id="box">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galle
y of type and scrambled it to make a type specimen book. It has survived not only
five centuries, but also the leap into electronic typesetting, remaining essenti
ally unchanged. It was popularised in the 1960s with the release of Letraset shee
ts containing Lorem Ipsum passages, and more recently with desktop publishing sof
tware like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>
</body>
</html>
Zerknij na wygląd w przeglądarce i "przeglądarce".
Widzimy dwa najczęściej pojawiające się problemy. Źle obliczona długość i nieumiejętność wycentrowania. Niby mało a strona rozwaliła się w drobny mak.
A wystarczy dodać w sekcji <head> (
po powyżej deklaracji styli):
<!--[if lte IE 6]>
<style type="text/css">
html, body {
text-align: center;
}
div#box {
width: 300px;
text-align: left;
}
</style>
<![endif]-->
... i strona wygląda jak powinna w każdej przeglądarce, nawet w badz
IEwiu.
To niech mi teraz ktoś pokaże prostszą metodę
----
Tak, wiem że jest tag [ php ] zamiast [ html ] Jak wiecie [ html ] żle formatuje wcięcia, dlatego aby je uwidocznić zastosowałem [ php ]