html - Html Css溢出到页面右侧
问题描述
我认为问题是div.ü
并且div.yayın
正在溢出页面的右侧,当我删除这些它没有发生时。我可以使用其他位置代码或其他东西吗?
div.ü{
position:relative;
left:10%;
vertical-align:top;}
div.yayın{
position:relative;
left:10%;
}
<div class="ü">
<a href="#">Yayın Akışı</a>
</div>
<div class="yayın">
<br>
<a href = "http://localhost/php/sistemler/haber.php">
<h3><img class="u" src = "images/7.jpg" class="" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de Fi"</h3>
</a>
<br>
<h3><img class="u" src = "images/7.jpg" class="" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de rm"</h3>
<br>
<h3><img class="u" src = "images/7.jpg" class="" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de um"</h3>
<br>
<h3><img class="u" src = "images/7.jpg" class="" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de um"</h3>
</div>
解决方案
您的 css 中有 3 个错误:
- 您的带类的 div
ü
不存在 - 它不是在 div 上使用,而是在图像上使用。
- 您的图像上有 2 个类属性。
max-width:90%;
如果你真的需要使用left:10%;
你的css,然后添加它,如下所示:
div.yayın{
position:relative;
left:10%;
max-width: 90%;
}
并替换left: 10%;
为margin-left:10%;
in class yay1n
。
演示
div .u{
position:relative;
margin-left:10%;
vertical-align:top;
}
div.yayın{
position:relative;
left:10%;
max-width: 90%;
}
<div class="yayın">
<br>
<a href = "http://localhost/php/sistemler/haber.php">
<h3><img class="u" src = "images/7.jpg" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de Fi"</h3>
</a>
<br>
<h3><img class="u" src = "images/7.jpg" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de rm"</h3>
<br>
<h3><img class="u" src = "images/7.jpg" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de um"</h3>
<br>
<h3><img class="u" src = "images/7.jpg" height = "125px" style="margin-right:20px;">Section 1.10.33 of "de um"</h3>
</div>