hr应该比div更长(宽度)

时间:2015-03-25 17:15:47

标签: html css width

我有一个网页,当平板电脑上显示该页面时,使用<hr>标签分隔内容。它看起来像这样:

image of webpage.

在红色矩形处,该线应该继续。但事实并非如此。为了让<hr>继续直到页面边框,我需要在html / css中进行哪些更改?

页面在这里:http://crossroads-festival.org/test2015/en/film/almaen 请注意将浏览器宽度重新设置为至少811px,以显示水平线。

感谢您的帮助!

更新 <hr>的css是

hr {
  height: 0;
  border: none;
  border-bottom: 1px solid #c1c1c1;
  margin-bottom: 1.5em;
  background: none;
}

divider-mobile类的css是:

.divider-mobile {
  margin-top: 3.125em;
  margin-bottom: 3.125em;
  overflow: visible;
  border: none;
  color: #888888;
  background-color: #888888;
  height: 1px;
  width: 150%;
  margin-left: -25%;
}

在html中我使用它:

<hr class="divider-mobile">

1 个答案:

答案 0 :(得分:1)

在CSS中你有:

#filmcontent {
  overflow-x: hidden;
}

这可以防止<hr>上的负边距转到页面边缘。

您还想删除width: 150%;上的margin-left: 25%<hr>,而不是......

margin-left: -20px;
margin-right: -20px;

(其中20px等于#content .entry-content上的填充)

这将为您带来理想的效果!