XHTML 1.0 Strict Валидация и няколко въпроса

Malfurion

Registered
Здравейте, от много време насам искам да се науча как да си оптимизирам сайта. Доста четох и стигнах до извода, че сайта за да е максимално оптимизиран и за Браузера и за Търсачките, трябва да е максималко изчистен и потреден, тоест валидиран според правилата XHTML 1.0 Strict.

Но това се оказа истинско приключение и осъкатяване на сайта, който започвам да правя, но мисля че ще се справя. От около 350 грешки ги сместих на 9. От които каквото и да направя се нещо се обърква. И това са 2-те форми, който съм сложил в сайта.

1. Формата за вход:
Код:
<form id="form1" method="post" action="http://smeh-bg.com/index1.php">
<div lang="bg" xml:lang="bg">Потребителско име:</div>
<input id="username" type="text" size="17"/>
<div lang="bg" xml:lang="bg">Парола:</div>
<input id="password" type="password" size="17"/>
<input type="submit" id="buton" value="Влез"/>
</form>
2. Формата за търсене на Гугъл
Код:
<form action="http://www.google.com/cse">
    <input type="hidden" id="cx" value="001994879148707437789:twbubri80vq"/>
    <input type="hidden" id="cof" value="FORID:0"/>
    <input id="q" type="text" size="20"/>
    <input type="submit" id="sa" value="Search"/> <input type="reset" value="Изчисти"/>

А грешките които изкарва са:
# Line 105, Column 43: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input id="username" type="text" size="17"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 107, Column 47: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input id="password" type="password" size="17"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 108, Column 45: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="submit" id="buton" value="Влез"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 109, Column 48: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="reset" id="button" value="Изчисти"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 119, Column 75: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

…value="001994879148707437789:twbubri80vq"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 120, Column 50: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="hidden" id="cof" value="FORID:0"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 121, Column 40: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input id="q" type="text" size="20"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 122, Column 48: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

<input type="submit" id="sa" value="Search"/> <input type="reset" value="Изчисти"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
# Error Line 122, Column 86: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

… <input type="reset" value="Изчисти"/>

✉

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

и въпроса ми е как да ги оправя.

Друга важна стъпка във оптимизирането на сайт е преминаването от таблици на ДИВ/ДИФ-ове. За мен това е една много трудна стъпка, понеже никога не съм работил с дивове и ми е ацки трудно, дори да започна, затова искам вашите съвети и искам да ви попитам, когато съм с дивове няма ли да се размества сайта на различните резолюции?

Това са ми въпросите, надявам се на надежден отговор :oops:

Благодаря Предварително :?:
 
Кой ти каза, че за да си оптимизираш сайта трябва да е задължително с xHTML STRICT и DIV-ове.

Всеки си решава как да си прави сайта било то с таблици, HTML 3, 4 Transitional и т.н.
 
StormBreaker каза:
Кой ти каза, че за да си оптимизираш сайта трябва да е задължително с xHTML STRICT и DIV-ове.

Всеки си решава как да си прави сайта било то с таблици, HTML 3, 4 Transitional и т.н.
Знам, но аз реших да е така...
 
И аз така правя, валидирам всичко под Strict. А относно проблема ти огледай да не си забравил да затвориш някой таг. Ако не си сложи двете формички в собствени ДИВ-ове. Иначе няма от какво да се получава друго, формичките са си добре. Иначе аз започнах направо с ДИВ-ове, никога не съм правил сайт с таблица и мисля, че това ми помогна доста. Отначало и на мен ми беше трудно да правя сайта да изглежда еднакво на всичко и на всякъде, но с времето свикваш. Една препоръка от мен ако искам сайта ти да изглежда добре под всички резолюции - не използвай position: absolute;. Но пак ти казвам със времето ще свикнеш.
 
Lam40 каза:
И аз така правя, валидирам всичко под Strict. А относно проблема ти огледай да не си забравил да затвориш някой таг. Ако не си сложи двете формички в собствени ДИВ-ове. Иначе няма от какво да се получава друго, формичките са си добре. Иначе аз започнах направо с ДИВ-ове, никога не съм правил сайт с таблица и мисля, че това ми помогна доста. Отначало и на мен ми беше трудно да правя сайта да изглежда еднакво на всичко и на всякъде, но с времето свикваш. Една препоръка от мен ако искам сайта ти да изглежда добре под всички резолюции - не използвай position: absolute;. Но пак ти казвам със времето ще свикнеш.

Точно така... Сложих ги в дифове и стана. Вече ми е валидирана на Strict и много се радвам(това как изглежда в момента е оттделен въпрос, но с времето ще я оправя)

Благодаря и за съвета, няма да го ползвам, но може ли да те помоля да ми направиш примерен layout с дифове? За да видя основите и как горе-долу стават нещата :)
 
Да естествено. Ще драсна нещо. :) Даже направо мога да извадя нещо от първите ми layout-чета.
 
Спретнах нещо на бързо. Незнам дали ще ти е от полза. Просто нищо друго не се сетих. Ако искаш нещо точно кажи. Това, което ти направих се вижда еднакво под всички бразъри и резолюции.

Layout - CSS

Това далеч не е нещо сложно, но за да видиш принципа - става :P

*Бележка: Използвал съм навсякъде height, просто за да се виждат елементите.
 
ех тези уроци , пишат се само да запълват мястото нали :P
http://web-tourist.net/login/login/view.php?st=505
 
mute каза:
ех тези уроци , пишат се само да запълват мястото нали :P
http://web-tourist.net/login/login/view.php?st=505
Този урок съм го виждал и съм го използвал но исках и друг пример... +1 за Lam40
 

Back
Горе