Witam
Przepisuję swoją stronę na standard zgodny z xHtml 1.0 (css także zgodny
z wytycznymi W3C). Oto przykład strony, która jest zgodna z xHtml.
W przeglądarce Opera oraz FireFox wszystko śmiga wspaniale (nie wiem dlaczego,
ale w FireFoxie czcionki są mniejsze, ale to nie ważne).
Strona ma rozszerzenie .php, jako że zawiera skrypty php, są także skrypty Java
(między innymi skrypt do menu).
Co zrobić żeby Internet Explorer wyświetlał ją poprawnie? W tej chwili w ogóle jej nie wyświetla
(wyświetla jako tekst, dokument xml - jak się uda - zazwyczaj nic nie wyświetla oprócz błędów).
Bardzo proszę o "poprawnienie" tego kodu - pewnie istnieją jakieś sztuczki, żeby móc to
wyświetlić w IE. Normalnie bym to olał, ale moją stronę, niestety, w około 70% odwiedzają użytkownicy IE :(
Oto kod strony (przykładowy szablon - ze skryptem javy, includowanymi skryptami php)
Header pobiera czas, footer wyswietla czas zaladowania strony, copyright wyswietla email i prawa autorskie.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- <?php echo '<?xml version="1.0" encoding="iso-8859-2" standalone="no"?'.">\n"; ?> -->
<!--(==============================================================)-->
<!--(Dokument utworzony 12.02.2006 )-->
<!--(==============================================================)-->
<?php
include "../header.php";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<title>Download</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" />
<link rel="stylesheet" type="text/css" href="wstyle.css" />
<?php echo '<?xml-stylesheet type="text/css" href="wstyle.css"?'.">\n"; ?>
<script type="text/javascript">
//<![CDATA[
// Autorem skryptu jest: SŁAWOMIR KOKŁOWSKI
// www.kurshtml.boo.pl
// Je?li chcesz wykorzystać ten skrypt na swojej stronie, nie usuwaj tego komentarza!
function przycisk(podstawowy, wskazany, klikniety, tekst)
{
if (document.images)
{
this.name = "img" + przyciski.length;
if (podstawowy) { this.normal = new Image(); this.normal.src = podstawowy }
if (wskazany) { this.over = new Image(); this.over.src = wskazany }
if (klikniety) { this.down = new Image(); this.down.src = klikniety }
}
if (tekst) this.opis = tekst;
this.normalizuj = normalizuj;
this.podswietl = podswietl;
this.kliknij = kliknij;
return this;
function normalizuj() { if (document.images) document.images[this.name].src = this.normal.src; window.status = "" }
function podswietl() { if (document.images && this.over) document.images[this.name].src = this.over.src; if (this.opis) window.status = this.opis }
function kliknij() { if (document.images) document.images[this.name].src = this.down.src }
}
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
przyciski = new Array("");
if (document.images)
{
przyciski[1] = new przycisk("../obrazki/menu/1a.gif", "../obrazki/menu/1b.gif", "../obrazki/menu/1c.gif", "Opis1");
przyciski[2] = new przycisk("../obrazki/menu/2a.gif", "../obrazki/menu/2b.gif", "../obrazki/menu/2c.gif", "Opis2");
przyciski[3] = new przycisk("../obrazki/menu/3a.gif", "../obrazki/menu/3b.gif", "../obrazki/menu/3c.gif", "Opis3");
przyciski[4] = new przycisk("../obrazki/menu/4a.gif", "../obrazki/menu/4b.gif", "../obrazki/menu/4c.gif", "Opis4");
przyciski[5] = new przycisk("../obrazki/menu/5a.gif", "../obrazki/menu/5b.gif", "../obrazki/menu/5c.gif", "Opis5");
przyciski[6] = new przycisk("../obrazki/menu/6a.gif", "../obrazki/menu/6b.gif", "../obrazki/menu/6c.gif", "Opis6");
przyciski[7] = new przycisk("../obrazki/menu/7a.gif", "../obrazki/menu/7b.gif", "../obrazki/menu/7c.gif", "Opis7");
przyciski[8] = new przycisk("../obrazki/menu/8a.gif", "../obrazki/menu/8b.gif", "../obrazki/menu/8c.gif", "Opis8");
}
//]]>
</script>
</head>
<body xml:lang="pl">
<table width="750" class="maintable" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="750" cellspacing="0" cellpadding="0">
<tr>
<td>
<img src="../obrazki/menu/logo.gif" width="750" height="108" alt="logo" />
<div>
<a href="strona1.php" onmouseover="przyciski[1].podswietl(); return true" onmousedown="przyciski[1].kliknij()" onmouseup="przyciski[1].podswietl(); return true" onmouseout="przyciski[1].normalizuj(); return true"><img src="../obrazki/menu/1a.gif" id="img1" border="0" alt="" /></a>
<a href="strona2.php" onmouseover="przyciski[2].podswietl(); return true" onmousedown="przyciski[2].kliknij()" onmouseup="przyciski[2].podswietl(); return true" onmouseout="przyciski[2].normalizuj(); return true"><img src="../obrazki/menu/2a.gif" id="img2" border="0" alt="" /></a>
<a href="strona3.php" onmouseover="przyciski[3].podswietl(); return true" onmousedown="przyciski[3].kliknij()" onmouseup="przyciski[3].podswietl(); return true" onmouseout="przyciski[3].normalizuj(); return true"><img src="../obrazki/menu/3a.gif" id="img3" border="0" alt="" /></a>
<a href="strona4.php" onmouseover="przyciski[4].podswietl(); return true" onmousedown="przyciski[4].kliknij()" onmouseup="przyciski[4].podswietl(); return true" onmouseout="przyciski[4].normalizuj(); return true"><img src="../obrazki/menu/4a.gif" id="img4" border="0" alt="" /></a>
<a href="strona5.php" onmouseover="przyciski[5].podswietl(); return true" onmousedown="przyciski[5].kliknij()" onmouseup="przyciski[5].podswietl(); return true" onmouseout="przyciski[5].normalizuj(); return true"><img src="../obrazki/menu/5a.gif" id="img5" border="0" alt="" /></a>
<img src="../obrazki/menu/6b.gif" id="img6" border="0" alt="" />
<a href="strona7.php" onmouseover="przyciski[7].podswietl(); return true" onmousedown="przyciski[7].kliknij()" onmouseup="przyciski[7].podswietl(); return true" onmouseout="przyciski[7].normalizuj(); return true"><img src="../obrazki/menu/7a.gif" id="img7" border="0" alt="" /></a>
<a href="strona8.php" onmouseover="przyciski[8].podswietl(); return true" onmousedown="przyciski[8].kliknij()" onmouseup="przyciski[8].podswietl(); return true" onmouseout="przyciski[8].normalizuj(); return true"><img src="../obrazki/menu/8a.gif" id="img8" border="0" alt="" /></a>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div>
<h1>Download</h1>
<div>
<h2>Wstep</h2>
<p align="justify"> Tekst...
<a href="http://www.onet.pl/"><span style="font-size: 13px">Jakis link</span></a>.
</p>
<img align="left" src="../obrazki/historia/w2x.gif" width="287" height="347" border="0" alt="2x" />
<hr />
<span style="font-size: 14px; font-weight: bold; color: #2B5885;">Naglowek 3</span>
</div>
</div>
</td>
</tr>
<!-- Stopka -->
<tr>
<td>
<hr />
<div class="footer"><?php include "../copyright.php"; ?><?php include "../footer.php"; ?></div>
</td>
</tr>
<tr>
<td>
<div align="center">
<a href="http://validator.w3.org/check/referer"><img src="../obrazki/glowna/valid-xhtml10.gif" width="121" height="18" border="1" alt="Valid XHTML 1.0 Transitional" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="../obrazki/glowna/vcss.gif" width="85" height="18" border="1" alt="Valid CSS!" /></a>
<a href="http://my.opera.com/USERNAME/affiliate/"><img src="../obrazki/glowna/opera.gif" width="91" height="17" border="1" alt="Opera - The fastest browser in the earth!" /></a>
<a href="http://www.firefox.pl/"><img src="../obrazki/glowna/firefox.gif" width="80" height="17" border="1" alt="Pobierz Firefoksa!" /></a>
</div>
</td>
</tr>
<!-- Koniec Stopki -->
</table>
I co z tym zrobić? Czy może poczekać na IE7, aż wprowadzą standardy do swojej "przeglądarki"...
Pozdr