0

The Error: Element style not allowed as child of element section in this context.

The code:

<section class="wrapper style4 container">
<h2 style="font-family:calibri;opacity:.0;">
    something here
</h2>

<!-- Content -->
<div class="content">
    <section>
        <h2 style="font-family:calibri;">something here</h2>
        <p style="font-family:calibri;">
            something here
        </p>
        <style>
            table {
                width: 100%;
            }

            table, th, td {
                border: 1px solid black;
                border-collapse: collapse;
            }

            th, td {
                padding: 5px;
                text-align: left;
            }

            table#t01 tr:nth-child(even) {
                background-color: #eee;
            }

            table#t01 tr:nth-child(odd) {
                background-color: #fff;
            }

            table#t01 th {
                background-color: black;
                color: white;
            }
        </style>
    </section>
</div>

Anyone could help me how to fix the error?

RajeshKdev
  • 6,365
  • 6
  • 58
  • 80
  • you should not use the `style` tag – Vivick May 04 '17 at 09:10
  • @Vivick _you should not use the `style` tag_ - why not? – Vucko May 04 '17 at 09:11
  • Its usage often leads to a misunderstanding of the cascading property of CSS declarations + makes your HTML bigger for no reason where you could easily avoid it using external sheets – Vivick May 04 '17 at 09:14
  • *Anyone could help me how to fix the error?* yes, put the styles in the head where they belong. –  May 04 '17 at 09:21
  • I need a table, so that's why I used – Andrius May 04 '17 at 11:35

0 Answers0