The w3.org validator eror

281 views Asked by At

The w3.org validator is giving me this error:

Line 322, Column 29: Element style is missing required attribute scoped.
<style type="text/css">

style my html code :

     <!DOCTYPE html>
    <head>
    <meta charset="UTF-8">
    <title>title</title>
    </head>
    <body>
    <style type="text/css"></style>
<script type="text/javascript"></script>
    </body>
    </html>

For Gravity forms addon in wordpress .

    <style type="text/css">
.gright,.gform_wrapper form ,.gform_wrapper ul li:before, .gform_wrapper ul li:after, .gform_wrapper ul.gform_fields {
text-align: right !important;
direction:rtl !important;
}
.gleft,.gform_wrapper input[type="url"], .gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"], .gform_wrapper input[type="number"], 
.gform_wrapper input[type="password"],body.rtl .gform_wrapper input[type="email"], body.rtl .gform_wrapper input[type="password"],
body.rtl .gform_wrapper input[type="url"], body.rtl .gform_wrapper input[type="tel"],body .gform_wrapper.gf_rtl_wrapper input[type="email"],
body .gform_wrapper.gf_rtl_wrapper input[type="password"], body .gform_wrapper.gf_rtl_wrapper input[type="url"], body .gform_wrapper.gf_rtl_wrapper input[type="tel"] {
text-align:left !important;
direction:ltr !important;
}
.gform_wrapper .ginput_complex .ginput_left {
float: right !important;
}
.gform_wrapper .ginput_complex .ginput_right {
float: left !important;
                        }
                        .gform_wrapper .gfield_checkbox li label,
                        .gform_wrapper .gfield_radio li label {
                            margin-right:20px !important;
                        }↩
                        .gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_first,
                        .gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_middle,
                        .gform_wrapper .ginput_complex.ginput_container.has_first_name.no_middle_name.has_last_name span.name_first{
                            margin-right:0px !important;
                            margin-left: 1.3% !important;
                        }
                    </style>

Please help me fix in html or addon in wordpress.

1

There are 1 answers

0
Rob On

The <style> element can have the scoped attribute applied to a section of a page and needs to be "scoped" to contain it in that section.

If present, it indicates that the styles are intended just for the subtree rooted at the style element's parent element, as opposed to the whole Document.

By putting the style element inside the body, the validator assumes you are trying to do this and, when you don't, flags it as an error. So, the error will go away if you do as others suggested and properly put the style inside the head element where it belongs or, otherwise, properly scope the style as the specification says. However, I don't recall if browsers do this yet.