Помогите с валидностью

D
На сайте с 28.06.2008
Offline
1114
1098

Line 20, Column 33: document type does not allow element "div" here; assuming missing "body" start-tag

<div class="PageBackgroundGlare">

Line 882, Column 20: required attribute "action" not specified

<form method="post"><select onchange="chk(this.form)" size="7"…

Господа, не пойму на что ругается валидатор?

D
На сайте с 30.09.2008
Offline
107
#1
Dram:

Line 882, Column 20: required attribute "action" not specified

<form method="post"><strong></strong><select onchange="chk(this.form)" size="7"…

Видимо из-за того что не указали атрибут action="" тегу <form ...>, а в первом случае тег <body> забыли открыть, скорее всего.

D
На сайте с 28.06.2008
Offline
1114
#2

Большое спасибо -так и есть в обоих случаях правы :)

Dram добавил 03.10.2010 в 21:02

Осталась одна ошибка, помогите уж и ее решить.

Есть модифицированный код сапы, который выводит ссылки в красочном контейнере типа Директ.

Вот его часть

$html = ''; $need_save_title_cache = false;

if($this->_imitate_direct)
{
if($total_page_links>0)
{
if(!$this->_direct_styles_printed)
{
$html .= '<style type="text/css">
.base {text-align: left; border: solid 1px #4A8EAD; padding: 0 0px 10px 5px; width: 100%; height: 92px; min-width: 100%; max-width: 100%; min-height: 92px; max-height: 92px; display:table; background: #EFEFEF; }
.base-row {display: table-row; padding: 5px 0px; font: normal 12px Tahoma;}
.base li {display: table-cell; width: 33%; vertical-align:top;}

.cell {padding-left:10px}
#block img {float: left; margin-bottom: -1px; margin-right: 3px;}

#block a {font-weight: bold; display: inline;}
#block span { margin-right: 5px;}
#rekl { margin-right: 5px; text-decoration: underline; margin-bottom: 5px }
#small {font: normal 10px Tahoma; color:black;}
span.initialcap {color: red;}

.clear {clear: both;}
</style>';
$this->_direct_styles_printed = true;
}

Валидатор ругается что <style type="text/css"> находится внутри боди. Как прописать в этом коде чтобы все стили убрать в общий файл css (который лежит /css/style.css)

Delarante
На сайте с 13.07.2008
Offline
69
#3

Думаю если удалите вот это:

<style type="text/css">
...
</style>

А это перенесете в CSS:


.base {text-align: left; border: solid 1px #4A8EAD; padding: 0 0px 10px 5px; width: 100%; height: 92px; min-width: 100%; max-width: 100%; min-height: 92px; max-height: 92px; display:table; background: #EFEFEF; }
.base-row {display: table-row; padding: 5px 0px; font: normal 12px Tahoma;}
.base li {display: table-cell; width: 33%; vertical-align:top;}

.cell {padding-left:10px}
#block img {float: left; margin-bottom: -1px; margin-right: 3px;}

#block a {font-weight: bold; display: inline;}
#block span { margin-right: 5px;}
#rekl { margin-right: 5px; text-decoration: underline; margin-bottom: 5px }
#small {font: normal 10px Tahoma; color:black;}
span.initialcap {color: red;}

.clear {clear: both;}

То все будет работать, и W3C будет доволен...

D
На сайте с 28.06.2008
Offline
1114
#4

В коде оставил


if(!$this->_direct_styles_printed)
{
$html .= '';
$this->_direct_styles_printed = true;
}

Стили перенес в главный ксс, валидатор доволен, но теперь ссылки сапы без красивых стилей.

Че то не применяются они

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий