Error stray start tag footer

Ошибка валидатора w3c "Stray start tag tr" HTML, CSS Решение и ответ на вопрос 2023258

0 / 0 / 0

Регистрация: 20.05.2013

Сообщений: 44

1

02.08.2017, 09:11. Показов 11614. Ответов 6


Всем привет, все перерыл в интернете, но не нашел как устранить проблему в валидаторе? может кто подскажет что означает эта проблема, и как ее вообще решить?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



112 / 108 / 42

Регистрация: 22.01.2017

Сообщений: 452

02.08.2017, 09:50

2

пропущен стартовый тег tr



0



0 / 0 / 0

Регистрация: 20.05.2013

Сообщений: 44

02.08.2017, 09:55

 [ТС]

3

в исходном коде ничего не пропущено и все сделано по html стандарту, вот что интересно есть table в него входит tr открывающий и соответственно после <td></td> закрывающий тег </tr>



0



112 / 108 / 42

Регистрация: 22.01.2017

Сообщений: 452

02.08.2017, 10:29

4

dimkaja357, покажите пациента.



0



dimkaja357

0 / 0 / 0

Регистрация: 20.05.2013

Сообщений: 44

02.08.2017, 10:32

 [ТС]

5

PHP/HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<tbody>
                                                        <?php $curNameTable = ''; ?>
                                                        <?php $curWireСross = 0.0; ?>
                                                        <?php foreach($subTableNames as $subTableName) { ?>
                                                        
                                                            <?php foreach($products as $product) { ?>
                                                                <?php if($product['subTableName'] == $subTableName['subTableName']) { ?>
 
                                                                    <?php if($curNameTable != $subTableName['subTableName']) { ?> 
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
                                                                        <tr>
                                                                            <td colspan="100%" style="text-align:left;">
                                                                                <strong><?php echo $subTableName['subTableName']; ?></strong>
                                                                            </td>  
                                                                        </tr>
                                                                    <?php } else {?> 
                                                                    <?php if($curWireСross != $product['WireСross']) { ?> 
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
                                                                        <?php } ?>
                                                                    <?php } ?>
 
                                                                    <?php $curWireСross = $product['WireСross']; ?>
                                                                    <?php  $curNameTable =  $subTableName['subTableName'];  ?> 
 
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="<?php echo $product['name']; ?>" href="<?php echo $product['href']; ?>"><?php echo $product['model'] ?></a></td>
                                                                    <td><?php echo $product['Dimension'] ?></td>
                                                                    <td><?php echo $product['OuterO'] ?></td>
                                                                    <td><?php echo $product['CuIndex'] ?></td>
                                                                    <td><?php echo $product['weight'] ?></td>
                                                                </tr>
                                                                <?php } ?>
                                                            <?php } ?>
                                                            
                                                        <?php } ?>
                                                        
                                                    </tbody>

P.S после и перед tbody — теги table



0



Модератор

Эксперт JSЭксперт HTML/CSS

3824 / 2674 / 1521

Регистрация: 12.07.2015

Сообщений: 6,674

Записей в блоге: 4

02.08.2017, 10:55

6

Вы валидатору тоже php-код скармливаете? Выкладывайте HTML.



0



dimkaja357

0 / 0 / 0

Регистрация: 20.05.2013

Сообщений: 44

02.08.2017, 14:19

 [ТС]

7

HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<div class="table_index_box">
                                                <table class="table_box table uk-table table-bordered uk-width-1-1">
                                                    <colgroup>
                                                        <col span="100%">    
                                                    </colgroup>
                                                    <thead>
                                                        <tr>
                                                            
                                                                <th>
                                                                    Номер артикула
                                                                </th>
                                                                <th>
                                                                    Размеры
                                                                </th>
                                                                <th>
                                                                    Наружный диаметр
                                                                </th>
                                                                <th>
                                                                    Вес меди
                                                                </th>
                                                                <th>
                                                                    Вес кабеля
                                                                </th>
                                                            
                                                        </tr> 
                                                    </thead>
                                                    <tbody>
                                                        
                                                                                                                                                                                                                                
                                                                                                                            
                                                                     
                                                                     
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
                                                                                                                                            
                                                                                                                                         
 
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="Кабель OPVC-JZ/OZ-YCY 2 X 0,5 мм2" href="http://tkdkabel.ru/index.php?route=product/product&amp;path=60_64_78_152&amp;product_id=292">1001093</a></td>
                                                                    <td>2 X 0,5</td>
                                                                    <td>7,0</td>
                                                                    <td>41,0</td>
                                                                    <td>70,0</td>
                                                                </tr>
                                                                                                                                                                                            
                                                                     
                                                                                                                                        
                                                                                                                                         
 
                                                
 
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="Кабель OPVC-JZ/OZ-YCY 2 X 0,75 мм2" href="http://tkdkabel.ru/index.php?route=product/product&amp;path=60_64_78_152&amp;product_id=300">1001092</a></td>
                                                                    <td>2 X 0,75</td>
                                                                    <td>7,5</td>
                                                                    <td>46,0</td>
                                                                    <td>83,0</td>
                                                                </tr>
                                                                                                                                                                                            
                                                                     
                                                                                                                                        
                                                                                                                                        
                                                                                                                                                                                            
                                                                     
                                                                     
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
                                                                                                                                            
                                                                                              
 
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="Кабель OPVC-JZ/OZ-YCY 4 G 6 мм2" href="http://tkdkabel.ru/index.php?route=product/product&amp;path=60_64_78_152&amp;product_id=335">1000705</a></td>
                                                                    <td>4 G 6</td>
                                                                    <td>15,8</td>
                                                                    <td>318,0</td>
                                                                    <td>485,0</td>
                                                                </tr>
                                                                                                                                                                                            
                                                                     
                                                                                                                                        
                                                                                                                                         
 
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="Кабель OPVC-JZ/OZ-YCY 5 G 6 мм2" href="http://tkdkabel.ru/index.php?route=product/product&amp;path=60_64_78_152&amp;product_id=336">1000719</a></td>
                                                                    <td>5 G 6</td>
                                                                    <td>17,0</td>
                                                                    <td>441,0</td>
                                                                    <td>609,0</td>
                                                                </tr>
                                                                                                                                                                                            
                                                                     
                                                                     
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
                                                                                                                                            
                                                                                                                                                                                                                                                         
                                                                     
                                                                                                                                        
                                                                                                                                         
 
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="Кабель OPVC-JZ/OZ-YCY 5 G 10 мм2" href="http://tkdkabel.ru/index.php?route=product/product&amp;path=60_64_78_152&amp;product_id=338">1000715</a></td>
                                                                    <td>5 G 10</td>
                                                                    <td>21,8</td>
                                                                    <td>714,0</td>
                                                                    <td>1.105,0</td>
                                                                </tr>
                                                                                                                                                      
                                                                     
                                                                     
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
                                                                <tr>
                                                                    <td><a target="_blank" data-uk-tooltip="{pos:'top-left'}" title="Кабель OPVC-JZ/OZ-YCY 4 G 25 мм2" href="http://tkdkabel.ru/index.php?route=product/product&amp;path=60_64_78_152&amp;product_id=340">1000700</a></td>
                                                                    <td>4 G 25</td>
                                                                    <td>28,9</td>
                                                                    <td>1.310,0</td>
                                                                    <td>1.720,0</td>
                                                                </tr>
                                                                        <tr>
                                                                            <td colspan="100%">
 
                                                                            </td>  
                                                                        </tr>
 
                                                                                                                                                                                        
                                                                                                                
                                                    </tbody>
                                                </table>

вот из исходного кода отрывок этот, сама таблица слишком большая тут только фрагмент

Добавлено через 3 часа 5 минут
Вопрос уже решил. Проблему нашел. Может быть кому то пригодится мой вариант решения проблемы, суть:

Stray (start или end) tag — означает что отмеченный валидатором тег без каких либо оснований был вставлен не к месту и не по правилам стандарта html. В моем случае ошибка была в том, что я не заметил в исходном коде отсутствие тегов table. На странице очень много таблиц, которые выводятся программно и я просто не туда куда нужно смотрел. Картина у меня была такая

HTML5
1
2
3
4
5
6
7
<div>Контент</div>
<tr>
<td>
Контент
</td>
</tr>
<div>Контент</div>



0



«Блуждающий нижний колонтитул начального тега» в валидаторе html?

Я не могу понять, почему я получаю эту ошибку:

Блуждающий нижний колонтитул начального тега.

Это код (контент я вынул, это только теги)

<!doctype html>

<head>
    <title>title</title>
    <meta charset="UTF-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
    <img src="heading.jpg" width="840" alt="pic">
    <!--<div id="container"></div> used ot set width of page -->
    <nav>
        <div id="columns">
            <a href="index.html">Home</a>
            <a href="products.html">Products</a>
            <a href="gift_ideas.html">Gift Ideas</a>
        </div>
        <br>
        <div id="link">
            <a href="link1.html">link1</a>|<a href="link2.html">link2</a>|<a href="link3.html">link 3</a>
        </div>
    </nav>
    <section>
        <br>
        <div id="homePage">
            <h1>Welcome</h1>
            <br>
            <div id="cart">
                <img src>
            </div>
        </div>
    </section>
</body>
<footer>
    <br>
    <h2>Contact Us</h2>
    Email: <a href="email@example.co.nz">email@example.co.nz</a>
    <img src>
</footer>

Я уверен, что закрыл все теги, так в чем проблема с нижним колонтитулом?

2 ответы

Вам нужно переместить </body> конечный тег в самом конце, потому что footer элемент не должен стоять после body элемент, но внутри него. Это следует из синтаксиса корневого элемента, html элемент: он содержит head элемент и body элемент, не более того.

Валидатор говорит «Блуждающий нижний колонтитул начального тега», потому что начальный тег появляется в контексте, в котором никакие элементы не могут быть запущены — после </body> тег, где только необязательный </html> тег может появиться.

Создан 22 сен.

Отсутствующий <html> добавлены теги, <footer> принес внутрь <body> ярлык. Хотя это и не имеет прямого отношения к вашему вопросу, также может показаться, что вы используете <br> теги, чтобы сделать пространство между различными элементами. Я бы посоветовал вам прекратить это делать и использовать CSS для настройки margin вместо этого свойства этих элементов.

Полный код ниже:

<!doctype html>
<html>
<head>
    <title>title</title>
    <meta charset="UTF-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
    <img src="heading.jpg" width="840" alt="pic">
    <!--<div id="container"></div> used ot set width of page -->
    <nav>
        <div id="columns">
            <a href="index.html">Home</a>
            <a href="products.html">Products</a>
            <a href="gift_ideas.html">Gift Ideas</a>
        </div>
        <br>
        <div id="link">
            <a href="link1.html">link1</a>|<a href="link2.html">link2</a>|<a href="link3.html">link 3</a>
        </div>
    </nav>
    <section>
        <br>
        <div id="homePage">
            <h1>Welcome</h1>
            <br>
            <div id="cart">
                <img src>
            </div>
        </div>
    </section>
    <footer>
        <br>
        <h2>Contact Us</h2>
        Email: <a href="email@example.co.nz">email@example.co.nz</a>
        <img src>
    </footer>
</body>
</html>

Создан 22 сен.

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

html
css
validation

or задайте свой вопрос.

A <head> start tag has been found in an unexpected place in the document structure. Check that the <head> section appears before the <body> section, and that is not duplicated.

The <head> section of an HTML document is the container of metadata about the document, and must appear before the <body> section. A common cause of this issue is duplicated <head> sections.

Here is an example of a minimal HTML document structure:

<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <p></p>
  </body>
</html>

A <script> start tag has been found in an unexpected place in the document structure. Check that the <script> section appears within the <head> or <body> sections.

Here’s an example of a script inserted in the head of the document:

<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
    <script>
      console.log("Hello from the head");
    </script>
  </head>
  <body>
    <p></p>
  </body>
</html>

A <style> start tag has been found in an unexpected place in the document structure. Check that the <style> section appears within the <head> section.

Although in general it’s better to put your styles in external stylesheets and apply them using <link> elements, CSS styles can also be included inside a document using the <style> tag. In this case, it should be placed within the <head> section, like in this example:

<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
    <style>
      p {
        color: #26b72b;
      }
    </style>
  </head>
  <body>
    <p>This text will be green.</p>
  </body>
</html>

Instead of using the isolang attribute to define the language of the document, you can use lang with an ISO 639-1 two character code.

For example, for Portuguese:

<html lang="pt">

Still checking your large sites one page at a time?

Save time using our automated web checker. Let our crawler check your web pages on the W3C Validator.

And end tag has been found that does not match the current open element. Check the context to fix the start and end tags.

An <a> tag can’t include other <a> tags inside. Most probable cause is an unclosed <a> tag, like in this example:

<a href="one.html">Page 1
<a href="two.html">Page 2</a>

Still checking your large sites one page at a time?

Save time using our automated web checker. Let our crawler check your web pages on the W3C Validator.

HTML documents are expected to start with a first line containing the Document Type Declaration, that defines the HTML version used. Since HTML5, it’s just <!DOCTYPE html>, which must appear before the start <html> tag.

Here’s an example of a minimal HTML5 document:

<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <p></p>
  </body>
</html>

All HTML documents must start with a <!DOCTYPE> (Document Type Declaration), that informs browsers about the type and version of HTML used to build the document. In HTML5, this is simply <!DOCTYPE html> and must appear at the start of the document.

Here is an example of a minimal HTML document, including the Document Type Declaration at its start:

<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <p></p>
  </body>
</html>

An end tag for X has been found that does not correspond to a previous open tag. This usually happens when you close the same tag twice, for example:

<ul>
  <li>item</li>
</ul>
</ul>

In HTML5, there’s no need to specify the version attribute — it is now obsolete. Here’s an example minimal HTML document to start with:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Test</title>
  </head>
  <body>
    <p></p>
  </body>
</html>

25,000 HTML checks per month. Fully automated.

Save time using our automated web checker. Let our crawler check your web pages on the W3C Validator.

Понравилась статья? Поделить с друзьями:
  • Error status file not found 0xc001000d
  • Error status ext ram exception 0xc0050005 ошибка flashtool как исправить ошибку
  • Error status exceed available range 0xc004000b перевод
  • Error status err 0xc0010001 sp flash tool
  • Error stray end tag head