Skip to main content
Inspiring
April 9, 2018
Answered

Not sure how to fix errors

  • April 9, 2018
  • 2 replies
  • 517 views

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 has been closed for replies.
    Correct answer osgood_

    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

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    April 9, 2018

    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.

    Nancy O'Shea— Product User & Community Expert
    osgood_Correct answer
    Legend
    April 9, 2018

    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

    jodmcc49Author
    Inspiring
    April 9, 2018

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