gpt4 book ai didi

css - 图像不适合容器并在 div 之外运行

转载 作者:行者123 更新时间:2023-11-28 17:22:35 24 4
gpt4 key购买 nike

我有一个内容(div),其中必须部署图像网格,但不幸的是图像网格不适合容器,它用完了 div。我已经在 jsfiddle 上上传了我的代码:

JsFiddle

我的 HTML 代码:

<div id="contentwrap">
<div id="content">
<p>Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language. While most often used to change the style of web pages and user interfaces written in HTML and XHTML, the language can be applied to any kind of XML document, including plain XML, SVG and XUL.</p>

<div class="MyBox">
<ul id="grid">
<li><a href="newgrid.html"><img src="http://www.nerdorturd.com/wp-content/uploads/2014/10/css_cascading_style_sheet.jpg"></a></li>
<li><a href="newgrid.html"><img src="http://www.nerdorturd.com/wp-content/uploads/2014/10/css_cascading_style_sheet.jpg"></a></li>
<li><a href="newgrid.html"><img src="http://www.nerdorturd.com/wp-content/uploads/2014/10/css_cascading_style_sheet.jpg"></a></li>
<li><a href="newgrid.html"><img src="http://www.nerdorturd.com/wp-content/uploads/2014/10/css_cascading_style_sheet.jpg"></a></li>
</ul>
</div>
</div>
</div>

最佳答案

简单添加

 height:auto;
overflow:auto;

class = MyBox

Working JsFiddle

关于css - 图像不适合容器并在 div 之外运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27762876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com