Home Forums Community Forum Where to adjust code to solve W3C validator Errors

Tagged: , , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • avadafusion
    Participant
    Post count: 1

    I am running a website through the W3C validator and it it giving a few errors because there is no value for img height, width, and alt text. I am able to locate the alt text but cannot locate where to remove the img height and width in fusionbuilder. Does anyone know how to go about fixes the error for the W3C validator?

    willkeyworth
    Participant
    Post count: 7

    seriously bogus coding 🙁

    Michael
    Keymaster
    Post count: 596

    Hi @avadafusion & @willkeyworth

    No, it is not bogus coding. The warnings and ‘errors’ if checked here > https://validator.w3.org/nu/?doc=https%3A%2F%2Favada.theme-fusion.com%2F – are not an issue.

    ----> Error: Element style is missing required attribute scoped.
    <style type="text/css">

    This scoped attribute is new in HTML 5, and when applied, it indicates that styling only applies to an elements parent and child elements AND NOT the entire page. It is required in this instance to facilitate our Element based options. It can’t affect your SEO negatively and will not have any bearing on compliance or performance of the site.

    Thank you kindly

    zurfluhc
    Participant
    Post count: 14

    Did you find a fix for this issue? I have same problem too, support is dismal.

    zurfluhc
    Participant
    Post count: 14

    Element style not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

    From line 80, column 2800; to line 80, column 2822

    bg-url=””><style type=”text/css”></style>

    Error: Element style not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

    From line 80, column 3519; to line 80, column 3541

    -wrapper”><style type=”text/css”>.fusio

    Contexts in which element style may be used:
    Where metadata content is expected.
    In a noscript element that is a child of a head element.
    Content model for element div:
    If the element is a child of a dl element: one or more dt elements followed by one or more dd elements, optionally intermixed with script-supporting elements.
    If the element is not a child of a dl element: flow content.

    entrest
    Participant
    Post count: 1

    Hello,

    Did you find a solution? I have the same problem.

    Error: Element style not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

    div></div><style type=”text/css”>.fusio

    Contexts in which element style may be used:
    Where metadata content is expected.
    In a noscript element that is a child of a head element.
    Content model for element div:
    If the element is a child of a dl element: one or more dt elements followed by one or more dd elements, optionally intermixed with script-supporting elements.
    If the element is not a child of a dl element: flow content.

    What piece of code fixes this?

    marklchaves
    Participant
    Post count: 816

    Hi,

    If a theme respects the WP core add_theme_support hook, the following should work. Place it in your child theme’s functions.php file.

    
    add_action(
        'after_setup_theme',
        function() {
            add_theme_support( 'html5', [ 'script', 'style' ] );
        }
    );
    

    Reference: https://codex.wordpress.org/Theme_Markup

    To try catching any stragglers, you can try Codeless’ solution (codeless dot co).

    
    function codeless_remove_type_attr($tag, $handle) {
        return preg_replace( "/type=['\"]text\/(javascript|css)['\"]/", '', $tag );
    }
    add_filter('style_loader_tag', 'codeless_remove_type_attr', 10, 2);
    add_filter('script_loader_tag', 'codeless_remove_type_attr', 10, 2);
    
    hotelyzer
    Participant
    Post count: 1

    How can i use this? Should I just copy both of these code parts in function.php or should i change something else?I am using Avada latest version.I tried to just paste in the functions but it’s not working. Many thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.