HTML to podstawy w dziedzinie tworzenia stron WWW, Style CSS warto opanować, bowiem za ich pomocą można dostosować odpowiednio wygląd swojej witryny WWW. Zagłębiamy się dalej i udostępniamy w tym forum możliwość zadawania pytań o JavaScript.
taracha
Posty: 3 Rejestracja: czw kwie 03, 2008 10:39 pm
Lokalizacja: Siemianowice Śląskie
Kontakt:
Post
autor: taracha » sob kwie 05, 2008 1:12 am
Witam,
mam bardzo dziwny problem, robie stronę zespołu znajomym
http://www.mmj.pl/~a_taracha/dobrze.JPG i mam zamapowaną grafikę w style.css (div'y po ID) strona przechodzi walidacje (w3c). Problem dotyka IE gdzie ta nie szczęsna przeglądarka niepoprawnie wyświetla mi ułożonej grafiki wraz z menu flash i iframe. Oto mój css...
Kod: Zaznacz cały
BODY
{
margin: 10px 10px 0 10px;
font-size: 8pt;
padding: 2px 20px 2px 0;
text-align: justify;
font-family: Arial;
background-color:#000000;letter-spacing:3
margin-top:0px;
margin-left:auto;
margin-right:auto;
margin-bottom:0px;
list-style: none;
float:center;
}
div#container {
width: 700px;
height: 600px;
margin: 0 auto;
background: #000;
}
#apDiv1 {
position:relative;
width:216px;
height:213px;
left: 0px;
top: 1px;
float:left;
}
#apDiv2 {
position:relative;
width:435px;
height:185px;
left: 0px;
top: 1px;
float:left;
}
#apDiv3 {
position:relative;
width:49px;
height:205px;
left: 0px;
top: -2px;
float:left;
}
#apDiv4 {
position:relative;
width:9px;
height:255px;
left: 36px;
top: 1px;
float:left;
clear:both;
}
#apDiv5 {
position:relative;
width:9px;
height:255px;
left: 146px;
top: 1px;
float:left;
}
#apDiv6 {
position:relative;
width:9px;
height:320x;
left: 636px;
top: -14px;
float:left;
}
#apDiv7 {
position:relative;
width:216px;
height:115px;
left: 0px;
top: -69px;
float:left;
clear:both;
}
#apDiv8 {
position:relative;
width:435px;
height:54px;
left: 0px;
top: -8px;
float:left;
}
#apDiv9 {
position:relative;
width:49px;
height:65px;
left: 0px;
top: -19px;
float:left;
}
#apDiv10 {
position:relative;
width:108px;
height:268px;
left: -171px;
top: -380px;
float:left;
}
#apDiv11 {
position:relative;
width:108px;
height:268px;
left: -105px;
top: -416px;
float:left;
}
img {
margin:0px; border:none 0px;
}
iframe {
width:433px;
height:344px;
background-color:#000000;
}
iii...w index.html wygląda to tak...
Kod: Zaznacz cały
<body class="text">
<div id="container">
<div id="apDiv1"> <img src="goralewarog.gif" width="216" height="213" alt="FSA"> </div>
<div id="apDiv2"> <img src="gora.gif" width="435" height="185" alt="FSA"> </div>
<div id="apDiv3"> <img src="goraprawarog.gif" width="49" height="205" alt="FSA"> </div>
<div id="apDiv4"> <img src="01.gif" width="9" height="255" alt="FSA"> </div>
<div id="apDiv5"> <img src="01.gif" width="9" height="255" alt="FSA"> </div>
<div id="apDiv6"> <img src="02.gif" width="9" height="320" alt="FSA"> </div>
<div id="apDiv7"> <img src="dollewyrog.gif" width="216" height="115" alt="FSA"> </div>
<div id="apDiv8"> <img src="dol.gif" width="435" height="54" alt="FSA"> </div>
<div id="apDiv9"> <img src="dolprawyrog.gif" width="49" height="65" alt="FSA"> </div>
<div id="apDiv10">
<object type="application/x-shockwave-flash" data="menudoFSA.swf" width="108" height="268">
<param name="movie" value="menudoFSA.swf">
</object> </div>
<div id="apDiv11">
<iframe src="start.html" name="textzone" id="textzone" frameborder="0" scrolling="no" marginheight="4" marginwidth="4">Twoja przegladarka nie akceptuje pływajacych ramek!</iframe> </div>
</div>
</body>
Pytanie Brzmi:
-co mam źle ? (że nie działa to w IE mimo poprawnej walidacji)
-jak to zrobić aby wszystkie przeglądarki (a mam na myśli gł. IE,FF,OPERA) wyświetlały to poprawnie...
Tutaj daje Print screen jak to wygląda u mnie w IE...
http://www.mmj.pl/~a_taracha/error.jpg
ooo_michal
Przelotem
Posty: 245 Rejestracja: śr kwie 18, 2007 9:06 am
Post
autor: ooo_michal » sob kwie 05, 2008 1:10 pm
Szczerze mówiąc przeraziłem się na widok tego kodu. Skomplikawany bardzo. A pod IE 7 wygląda jeszcze gorzej. Przygotowałem zupełnie inaczej tę stronkę. Działa poprawnie pod IE7 i Operą, kod jest o wiele protszy i przejrzystrzy a całoś jest zgodna z xHTML 1.1 (oprócz tagu iframe, nie korzystam z niego więc nie wiem co jest źle). Oto cały kod:
index.html
Kod: Zaznacz cały
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl">
<head>
<meta http-equiv="Content-type" content="application/xhtml+xml; charset=utf-8" />
<title> [tytuł strony] </title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="content">
<div id="top"></div>
<div id="center">
<div id="center-left">
<object type="application/x-shockwave-flash" data="menudoFSA.swf" width="108" height="268" style="display:block;width:108px;height:268pxl;margin-top:36px;margin-left:45px;">
<param name="movie" value="menudoFSA.swf" />
</object>
</div>
<div id="center-frame">
<iframe src="start.html" name="textzone" id="textzone" frameborder="0" scrolling="no" marginheight="4" marginwidth="4" style="width: 433px; height: 344px;">Twoja przegladarka nie akceptuje pływajacych ramek!</iframe>
</div>
<div id="center-right"></div>
</div>
<div id="bottom"></div>
</div>
</body>
</html>
style.css
Kod: Zaznacz cały
body {
margin: 0px;
padding: 0px;
font:12px Arial;
text-align:center;
background-color:#000000;
}
div {
overflow: hidden;
}
#content {
width: 700px;
height: 599px;
margin:10px auto;
text-align:left;
background-color:#ff0000;
}
#top {
height: 181px;
background: url('top.png') no-repeat;
}
#center {
height: 344px;
}
#center-left {
width: 219px;
height: 344px;
float: left;
background: url('left.png') no-repeat;
text-align: left;
}
#center-frame {
width: 433px;
float: left;
height: 344px;
background-color:#ffffff;
overflow: auto;
}
#center-right {
width: 48px;
height: 344px;
background: url('right.png') no-repeat;
float: left;
}
#bottom {
height: 74px;
background: url('bottom.png') no-repeat;
}
Mam nadzieję, że pomogłem.
Pozdrawiam.
taracha
Posty: 3 Rejestracja: czw kwie 03, 2008 10:39 pm
Lokalizacja: Siemianowice Śląskie
Kontakt:
Post
autor: taracha » ndz kwie 06, 2008 12:14 am
ooo_michał pomogłeś mi w pewnym stopniu... dałeś mi bardzo dobry przykład.
A co do sedna całego problemu to Internet Explorer to bardzo wybredna przeglądarka, trzeba sie na wyginać trochę i przede wszystkim sprawdzać na bieżąco w kilku przeglądarkach czy wyświetla tak jak chcemy (najlepiej FF i IE ). Mapując grafikę na DIV'ach w style.css
nie należy dawać za dużo poleceń bo później powstają n
IE spodzianki. ^^
Kod: Zaznacz cały
<body class="text">
<div id="container">
<div id="top">
<div id="apDiv1"><img src="goralewarog.gif" width="216" height="213" alt="FSA"></div>
<div id="apDiv2"><img src="gora.gif" width="435" height="185" alt="FSA"></div>
<div id="apDiv3"><img src="goraprawarog.gif" width="49" height="205" alt="FSA"></div></div>
<div id="main">
<div id="apDiv4"><img src="01.gif" width="9" height="255" alt="FSA"></div>
<div id="apDiv10">
<object type="application/x-shockwave-flash" data="menudoFSA.swf" width="108" height="268">
<param name="movie" value="menudoFSA.swf"></object></div>
<div id="apDiv5"><img src="01.gif" width="9" height="255" alt="FSA"></div>
<div id="apDiv11">
<iframe src="start.html" name="textzone" id="textzone" frameborder="0" scrolling="no" marginheight="4" marginwidth="4">Twoja przegladarka nie akceptuje pływajacych ramek!</iframe></div>
<div id="apDiv6"><img src="02.gif" width="9" height="320" alt="FSA"></div></div>
<div id="bottom">
<div id="apDiv7"><img src="dollewyrog.gif" width="216" height="115" alt="FSA"></div>
<div id="apDiv8"><img src="dol.gif" width="435" height="54" alt="FSA"></div>
<div id="apDiv9"><img src="dolprawyrog.gif" width="49" height="65" alt="FSA"></div></div>
</div>
Kod: Zaznacz cały
div#container {
width: 700px;
height: 600px;
margin: 0 auto;
background: #000;
}
#top { height:216px;}
#apDiv1 {
position:relative;
width:216px;
height:213px;
float:left;
}
#apDiv2 {
position:relative;
width:435px;
height:185px;
float:left;
}
#apDiv3 {
position:relative;
width:49px;
height:205px;
float:left;
}
#main { height:344px; position:relative;}
#apDiv4 {
position:relative;
width:9px;
height:255px;
top:-3px;
left:36px;
float:left;
}
#apDiv10 {
position:relative;
width:108px;
height:268px;
top:2px;
left:37px;
float:left;
}
#apDiv5 {
position:relative;
width:9px;
height:255px;
top:-3px;
left:38px;
float:left;
}
#apDiv11 {
position:relative;
width:433px;
height:344px;
top:-32px;
left:88px;
float:left;
}
#apDiv6 {
position:relative;
width:9px;
height:320px;
top:-11px;
left:-37px;
float:right;
}
#bottom { height:115px; position:relative; }
#apDiv7 {
position:relative;
width:216px;
height:115px;
top:-92px;
float:left;
clear:both;
}
#apDiv8 {
position:relative;
width:435px;
height:54px;
float:left;
top:-31px;
}
#apDiv9 {
position:relative;
width:49px;
height:65px;
float:left;
top:-42px;
}
img {
margin:0px; border:none 0px;
}
iframe {
width:433px;
height:344px;
background-color:#000000;
}
iii temat zamknięty