在背景图像中的行

时间:2014-05-07 19:42:26

标签: 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>

1 个答案:

答案 0 :(得分:0)

正在发生的原因是因为背景重复:重复; 要解决此问题,请更改为no-repeat:true;并将html高度设置为100%