我用div在表格的两边做了两个图像,但是一旦div结束了,我用<p>
输入的文本就会出现在div的上面,尽管在代码的后面。我希望文本出现在表格的下面。
<!Doctype html>
<html>
<head>
<link rel = "stylesheet" type = "text/css" href="website.css"/>
<title> Stoge Guitars </title>
</head>
<body>
<div id = "container">
<div id = "X">
<img src= "images/workshop.png" id = "guitar">
</div>
<div id = "C">
<img src= "images/workshop.png" id = "guitar2">
</div>
<div id = "V">
<table>
<tr>
<th colspan = "5" id = "STOGEGUITARS"> STOGE GUITARS </th>
</tr>
<tr>
<th>Home</th>
<th>Our Custom Guitars</th>
<th>Forum</th>
<th>Workshop Gallery</th>
<th>Contact Us</th>
</tr>
</table>
</div>
</div>
<p> This should be below the table </p>
</body>
字符串
CSS
body
{
Background-image: url("http://images.epiphone.com.s3.amazonaws.com/Products/Les-Paul/Les-Paul- Standard-Plustop-PRO/Gallery/POP_LPSTDPLUSPRO-HB.jpg");
background-size: 100% 100%;
background-repeat: no-repeat;
background-size: cover;
}
#STOGEGUITARS
{
font-size: 20pt;
font-family: "Times New Roman", Times, serif;
font-style: italic;
}
table, th, td
{
border: 1px solid black;
}
table
{
width: 60%;
margin-left: 20%;
margin-right: 20%;
position: fixed;
}
#guitar
{
float: left;
}
#guitar2
{
float: right;
}
#guitar
{
width: 19%;
height: 100%;
position: fixed;
}
#guitar2
{
width: 19%;
height: 100%;
position: fixed;
right: 0px;
}
p
{
border: 0px;
text-align: left;
}
型
如果我犯了一个愚蠢的错误,我很抱歉,我只有16岁,是HTML和CSS的新手。
3条答案
按热度按时间eulz3vhy1#
检查此fiddle
字符串
是你要找的,位置固定使其他元素忽略元素的位置
cdmah0mi2#
我修改了你的HTML和CSS代码:
个字符
guykilcj3#
只是字面上把一个权利下,你想把东西下,它做了刚才,它的工作!:D