Skip to main content
Inspiring
Apr 9, 2018 6:04 PM UTC
Answered

Not sure how to fix errors

I am using a Bootstrap 3 panel accordion and have quite a few errors, but I'm not sure what I need to do to correct them. I think because of the errors, the open/collapse has stopped working. This is the first but repeating error message I'm getting when running the validator:

Line 72   Bad value 100% for attribute height on element img : Expected a digit but saw % instead. [html5]

Here is the link: http://www.renegadescookingteam.com/sponsors.html

Any helpful insight would be greatly appreciated.

John

    This topic is closed to new replies. Start a new post to keep the conversation going.
    osgood_Correct answer
    Legend
    Apr 9, 2018 6:27 PM UTC

    html 5 doesnt allow % on width or height so you need to convert it to inline css:

    <img src="images/2014_SponsBrd_names_print.jpg" style="width: 100%; height: 100%;" alt=""/>

    or better, get rid of all the width and heights from your accordion images:

    <img src="images/2014_SponsBrd_names_print.jpg" alt=""/>

    and use css to target all of the images in the accordion <div>:

    #accordion img {

    width: 100%;

    height: 100%;

    }

    Accordion opens and collapses for me, nothing to do with the errors about the images

    3 replies

    Nancy OShea
    Community Expert
    Community Expert
    Apr 9, 2018 7:23 PM UTC

    jodmcc49  wrote

    I am using a Bootstrap 3 panel accordion and have quite a few errors, but I'm not sure what I need to do to correct them. I think because of the errors, the open/collapse has stopped working.

    You have to click the text link to open panels.   It works for me in Firefox.

    Translate
    Nancy O'Shea— Product User & Community Expert
    osgood_Correct answer
    Legend
    Apr 9, 2018 6:27 PM UTC

    html 5 doesnt allow % on width or height so you need to convert it to inline css:

    <img src="images/2014_SponsBrd_names_print.jpg" style="width: 100%; height: 100%;" alt=""/>

    or better, get rid of all the width and heights from your accordion images:

    <img src="images/2014_SponsBrd_names_print.jpg" alt=""/>

    and use css to target all of the images in the accordion <div>:

    #accordion img {

    width: 100%;

    height: 100%;

    }

    Accordion opens and collapses for me, nothing to do with the errors about the images

    Translate
    jodmcc49Author
    Inspiring
    Apr 9, 2018 7:56 PM UTC

    Thank you for the explanation. And thank you to all who replied.

    Translate