I have a gallery in which i'm using the figure and figcaption tags. This displays fine in all modern browsers but in IE8 it breaks the CSS for the figure and figcaption tags because the browser doesn't support them. Just including the html5shiv library doesn't fix it. Is there a method within that I would have to call?

有帮助吗?

解决方案

the problem was that the figure element did not automatically size to the picture it contained so it needed to be specifically set in the CSS

其他提示

I ran into this same issue and found that it stemmed from specifying max-width: 100% for img elements. If I remove this declaration, IE8 renders the images at the appropriate sizes. Unfortunately, it means they won't responsively size on smaller screens. The best solution I know of is to specify max-width: none using a conditional comment that's applied only in IE8 and earlier:

<!--[if lt IE 9]>
   <style rel="stylesheet">
      img {max-width: none;}
   </style>
<![endif]-->

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top