如何将文本放在div标签下面?

斯图尔特

我已经使用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的新手。

divy3993

我已经修改了您的HTML和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;
  margin:0;
}

#STOGEGUITARS {
  font-size: 20pt;
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
}

table, th, td {
  border: 1px solid black;
}

table {
  width:100%;
}

#X {
  display:inline-block;
  position: fixed;
  left:0px;
  top:0px;
  width: 19%;
  height: 100%;
}

#V {
  margin:0;
  display:inline-block;
  top:0px;
  width: 62%;
  height: 100%;   
  border:1px solid red; /* Remove this line it's just for checking boundaries  */
}

#C {
  display:inline-block;
  position: fixed;
  right:0px;
  top:0px;
  width: 19%;
  height: 100%;
}

img {
  width:100%;
  height:100%;
}

p {
  position:relative;
  text-align:left;
}
<center>
<div id = "container">
    <div id = "X">
        <img src= "https://fedoraproject.org/w/uploads/6/66/Artwork_F9Themes_Shoowa_shoowa-horizontal.png" id = "guitar" />
    </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>
        <p> This should be below the table </p>
    </div>
    <div id = "C">  
        <img src= "https://fedoraproject.org/w/uploads/6/66/Artwork_F9Themes_Shoowa_shoowa-horizontal.png" id = "guitar2" />
    </div>
    </div>
</center>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何删除在wordpress的body标签下面写的默认文本?

来自分类Dev

如何将光标放在具有contenteditable的div标签中文本的末尾

来自分类Dev

如何将 <script> 标签放在 <div> 标签中?

来自分类Dev

Selenium XPATH如何从输入id标签下面的Span标签获取文本

来自分类Dev

如何将<div>放在表格标签中?

来自分类Dev

如何将ContextMenuStrip放置在链接标签下方?

来自分类Dev

如何将一个div放在另一个下面

来自分类Dev

如何将元素直接放在元素下面

来自分类Dev

如何从主div标签下的第一个sub div标签中抓取文本

来自分类Dev

如何将 div 标签内的文本与链接对齐。

来自分类Dev

将 div 定位在 a 标签下

来自分类Dev

如何将文本放在标题的前面?

来自分类Dev

如何将文本字段和标签放在7x3的网格中?

来自分类Dev

如何将按钮与文本(标签)放在同一行

来自分类Dev

如何将文本放在另一个div的div底部

来自分类Dev

如何将div放在页面顶部

来自分类Dev

如何将div放在容器内?

来自分类Dev

如何将 ap 放在 div 的中心?

来自分类Dev

将div放在广告之上,而不是下面

来自分类Dev

如何将文本放在带边框的文本旁边?

来自分类Dev

刮除引号中div标签下的文本

来自分类Dev

无法使用硒选择“div”标签下的文本

来自分类Dev

如何在div标签下抓取多个图片标签

来自分类Dev

如何将AbstractButton的标签放在Icon的底部?

来自分类Dev

如何将img放在svg标签前面

来自分类Dev

如何将AbstractButton的标签放在Icon的底部?

来自分类Dev

如图所示,如何将标签放在图表的列上

来自分类Dev

如何将单选按钮标签放在单行中

来自分类Dev

如何将标签放在按钮上?

Related 相关文章

热门标签

归档