我花了两天时间试图解决无花果/无花果问题无济于事.
我有一个Django应用程序,用户可以在其中提交图像,我正在使用图形和figcaption标签来显示带有附带标题的图像.主要问题是标题宽度超出图片宽度.
我试图找出一种方法让图像保持相同的大小和标题,以相应地排列宽度.我也在使用Twitter-Bootstrap.我对所有解决方案持开放态度.任何意见,经验或建议都非常感谢.
更新:这是实际的HTML模板代码和CSS:
{% if story.pic %}
Image
{% if story.caption %}
{{story.caption}}
{% endif %}
{% endif %}
image {height:auto;}
figure {margin:0; display:table;}
figcaption {display:table-row;
max-width: 30%;
font-weight: bold;}