html - 背景图像中的线条

标签 html css

所以我的网站上有一张背景图片,但如果你仔细观察,你会看到一条小线穿过图片,位于第一个 div 框(名为 .transbox2)上方和下方第二个 div 框(名为 .transbox)。为什么会有这些线条,我可以删除它们吗?

我截取了图片的样子。你可以在这里找到它:

enter image description here

你会明白我对背景图片的意思。

最后,这是背景图片本身。请注意,在 div 框的顶部和底部上方或下方没有线条:

enter image description here

这是我的 CSS:

#minimal_table_for_Master_Evan {
    font-family: "Calibri", "Times New Roman", Serif;
    font-size: 12px;
    font-weight: bold;
    margin: 20px;
    width: 55%;
    border-collapse: collapse;
    text-align: left;
}

#minimal_table_for_Master_Evan td {
    color: #000;
    padding: 6px 8px;
    border-bottom: 1px solid #000;
}

html, body {
    background-image:url("ADPBackground.jpg");
    background-repeat: repeat;
}
p, h2, h4, li {
    font-family: "Calibri", "Times New Roman", Serif;
}

li {
    list-style-position:inside;

}

.transbox {
    width: 50%;
    margin:30px 50px;
    background-color:rgba(255,255,255, 0.3);
    filter:alpha(opacity=60); /* For IE8 and earlier */
    border-radius:25px;
    padding: 2em;
}

.transbox2 {
    width: 50%;
    margin:30px 50px;
    background-color:rgba(255,255,255, 0.6);
    opacity: 0.6;
    filter:alpha(opacity=60); /* For IE8 and earlier */
    border-radius:25px;
    padding: 1em 2em;
}

.transbox p {
    margin:30px 40px;
    font-weight:bold;
    color:#000000;
}

这是我的 HTML:

<!DOCTYPE html>
<center>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet-test.css"/>

<title></title>

</head>

<body>

<div class="transbox2">
<img src="logo" width="134" height="60">
</div>

<div class="transbox">

<h2>Header</h2>

<p>
    Nice paragraph
</p>

<h4>Header</h4>

<ol>
    <li>Blank text</li>
    <li>Blank text</li>
    <li>Blank text</li>
</ol>

<form method="post" action="mailto:name@email.com">

<table id="minimal_table_for_Master_Evan">
<tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
</tr>
<tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
</tr>
</table>

<p></p>

<input type="submit" value="Save" id="save">
</form>
</div>

</body>

</center>
</html>

最佳答案

发生这种情况的原因是因为 background-repeat: repeat; 要解决此问题,请更改为 no-repeat: true;并将 html 高度设置为 100%

关于html - 背景图像中的线条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23526894/

相关文章:

html - 固定位置在标题和导航菜单中不起作用

html - 无法在 Bootstrap 中对齐输入

css - 如何在我自己的类定义中包含来自 twitter bootstrap 的标签信息?

javascript - 在没有 Javascript 或 HTML 的情况下为表单输入赋值,就像 outlook.com 所做的那样

html - 介绍页面中的响应式图像和视频

javascript - 如何使用 jQuery 删除跨度数值的 25%?

javascript - 当我放置 html5 文档类型声明时,jquery 不工作

html - xpath 根据(相对)子内容选择父级

css - 如何设置与屏幕分辨率成比例的 div 高度?

css - 为什么我的 CSS 下拉菜单在 IE7 中的 DIV 后面打开?