Stránka 1 z 1

Jak opravit chybu v xhtml kodu?

Napsal: 08 lis 2008 21:27
od BRABO[*_*]
Dobrý večer
Potřeboval bych poradit. Jak opravit tuto chybo v mém kódu? Z 39 chyb jsem, se dopracoval k jedné a nevím jak jí opravit.
Stále mi to vypisuje, že je chyba zde <center>. Jestli mi neporadíte ani vy tak už jsem v koncích.
PS: Sice mi to tam píše čím to je, ale má angličtina je mizerná a z toho co jsem si přeložil nechápu jak to opravit.

Kód: Vybrat vše

   1.   Error  Line 50, Column 10: element "center" undefined.

               <center><h2><span style="color: black">Upozornění:</span></h2></center>


      You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
          * incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
          * by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
          * by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).

Re: Jak opravit chybu v xhtml kodu?

Napsal: 08 lis 2008 21:32
od Myloš
Zřejmě používáš <!DOCTYPE, ve kterém <center> není (nesmí být).
Pokud ti jde o funkčnost, kašli na to; prohlížeče nesmějí <center> neumět.
Pokud ti jde o validitu, použij vlastnost align s hodnotou center (buď jako HTML <h2 align="center">, nebo přes CSS).

Pokud dobře nerozumíš anglickým hláškám, používej český validátor: http://validator.w3.cz/

Re: Jak opravit chybu v xhtml kodu?

Napsal: 08 lis 2008 21:40
od BRABO[*_*]
Děkuji ty moc. Bez tebe bych na to nepřišel. Dík za ten typ na ten validátor určitě ho použiji.

Re: Jak opravit chybu v xhtml kodu?

Napsal: 08 lis 2008 21:43
od Tholus
Stačí do css vložit toto:

.center {text-align: center;}

Místo <center>:

<div class="center">

A místo </center>:

</div>

:wink:

EDIT: Sorry, pokud jsi to předtím zkoušel, nešlo to, protože jsem napsal místo text-align align. Teď je to opravený. :wink: