Issue
I have used divs to make two images both sides of a table, however once the divs have ended the text i input with <p>
appear above the divs despite being later in the code. I want the text to appear below the table.
here is my code.
<!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;
}
Help will be greatly appreciated thanks. Sorry if i've made a silly mistake, i am only 16 and new to HTML and CSS.
Solution
I have modified your both HTML and CSS code:
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>
Answered By - divy3993
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.