I need to do a position: absolute on my images.The problem is they move when I resize the browser.No other element including images do this until I attempt to use the position: absolute element.I know there are other ways to maybe accomplish this but I really need to learn how to use this element in a responsive design.My website is www.michaelmorris.website. The way it’s viewed on my home page under a large monitor is how I want it when resized of course smaller but not having the images moving all over the place. I can also create a screen shot of what I want. I do not want to go with another method if I don’t have to. I want to know why position absolute doesn’t work.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<meta name="viewport" content="width=device-width,initial-scale=1.5">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="michaelmorris1a.css">
<link rel="stylesheet" type="text/css" href="footer.css">
<title>The HTML5 Herald</title>
<!--
https://www.sitepoint.com/community/t/divs-moving-downward-when-i-resize-the-browser/224155
morrism35 (michael morris)
May 16,2016 2:56 AM
-->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
html,body {min-height:100vh;}
body {
font-size:100%;
background-image:url("Images/solid maroon.png");
background-repeat:no-repeat;
background-size:100% 100%;
padding:0;
margin:0;
}
.bgwrap.h {
background-image:url("Images/Top Banner.jpg");
background-repeat:no-repeat;
background-size:100% 100%;
}
.bgwrap.d {
background-color:rgba(0,0,0,.3);
}
.container {
max-width:800px;
margin:0 auto;
/* outline:1px solid lime; /* TEST Outline. To Be DELETED. */
}
.names {
display:table;
width:100%;
padding:2vh 0;
/* outline:1px solid yellow; /* TEST Outline. To Be DELETED. */
}
.tcell {
display:table-cell;
text-align:center;
vertical-align:bottom;
/* outline:1px solid blue; /* TEST Outline. To Be DELETED. */
}
.m,.c {
text-align:right;
color:#eee8aa;
font-size:1.825em;
font-style:italic;
text-transform:uppercase;
width:35%;
}
.c {
text-align:left;
width:40%;
}
.ring {
display:block;
max-width:60px;
height:auto;
margin:0 auto 20px;
}
.date {
display:table;
width:100%;
max-width:550px;
border-spacing:6px 8px;
color:#eee8aa;
text-transform:uppercase;
font-size:1.25em;
font-style:italic;
margin:0 auto;
}
.date span {
display:table-cell;
vertical-align:middle;
text-align:center;
width:56%;
/* outline:1px dotted lime; /* TEST Outline. To Be DELETED. */
}
.date span + span {
width:44%;
}
img{
max-width: 100%;
}
#tes{
margin: 0;
padding: 0;
list-style: none;hnnbvcxzbc
border: 5px solid #eee8aa;
}
li a{
color: #FFFFFF;
font-size:1.82em;
font-style:italic;
list-style: none;
}
#MasterContainer{
width: 100%;
margin: 0px;
}
.r1{
width: 20%;
position: absolute;
top: 20%;
left: 25%;
}
.r2{
width: 40%;
position: absolute;
top: 20%;
left: 40%;
}
.r3{
width: 20%;
position: absolute;
top: 35%;
left: 25%;
}
.r4{
position: absolute;
top: 20%;
right: 10%;
width: 20%;
}
.r5{
position: absolute;
top: 35%;
right: 10%;
width: 20%;
}
.container.i {
padding-top:3vh;
}
.wedding{
border: 5px solid #eee8aa;
width: 50%;
}
@media screen and (max-width: 650px) {
body {font-size:40%;}
.r1{
top: 15%;
left: 20%;
}
.r2{
top: 15%;
left: 35%;
}
.r3 {
top: 25%;
left: 20%;
}
.r4{
top: 25%;
left: 20%;
}
.r5 {
top: 35%;
left: 20%;
}
}
</style>
</head>
<body>
<div class="bgwrap h">
<div class="container">
<div class="names">
<div class="tcell m">Michael</div>
<div class="tcell"><img class="ring" src="Images/gold.gif" alt="Wedding Ring" width="120px" height="60px"></div>
<div class="tcell c">Christina</div>
</div>
</div>
</div>
<div class="bgwrap d">
<div class="container">
<div class="date">
<span>Sept 2, 2016 7:00 PM</span><span>Salisbury, NC</span>
</div>
</div>
</div>
<div id="MasterContainer">
<section>
<ul id="tes">
<li class="l"><a href="index.html">Home</a></li>
<li class="l"><a href="gallery.html">Gallery</a></li>
<li class"l"><a href="MessageBoard.php">Messages</a></li>
<li class"l"><a href="About.html">About Us</a></li>
<li class="r1"><img src="http://michaelmorris.website/Images/Roses.jpg"> </li>
<li class="r2"><img src="http://michaelmorris.website/Images/save date.jpg"></li>
<li class="r3"><img src="http://michaelmorris.website/Images/Roses.jpg"> </li>
<li class="r4"><img src="http://michaelmorris.website/Images/Roses.jpg"></li>
<li class="r5"><img src="http://michaelmorris.website/Images/Roses.jpg"> </li>
</ul>
</section>
<div class="footer">
<p class="contact">Michael Morris</br> 905 Hoke Street</br> Kannapolis, NC 28081</br>704-783-7696</br>
morrism35@yahoo.com</br>www.michaelmorris.website</p>
<div class="names">
<div class="tcell m">Michael</div>
<div class="tcell"><img class="ring" src="Images/gold.gif" alt="Wedding Ring" width="120px" height="60px"></div>
<div class="tcell c">Christina</div>
</div>
<p class="contact2">Christina Vandivier</br> 905 Hoke Street</br> Kannapolis, NC 28081</br>704-467-6934</br>
chrisitnavandivier@gmail.com</br>www.michaelmorris.website</p>
</div>
</div>
</body>
</html>