Reputation: 81
How do a get a div to be in the same place no matter what the users screen size is. I notice when a view my code on a different computer with a bigger screen that my div (with an image) is not in the same place as it was on my laptop, is there any way to make it sit in the same place not matter the browser?
Here is my code
#pic {
padding-left: 300px;
}
#about {
padding-left: 50px;
text-align: center;
padding-right: 100px;
line-height: 2.5;
font-size: 120.5%;
}
<div id="pic">
<img class="errorimage" src="IMG_4847.png" alt="" title="">
</a>
</div>
<div id="about">
<h1>Rebekah</h1>
<h2>Web Design. Google Adwords. Google Analytics.</h2>
</div>
Upvotes: 2
Views: 38
Reputation: 10040
You can use position:absolute
to have it in a fixed position no matter scaling
Also position:fixed
will keep it in the same location in the window even while scrolling
http://www.w3schools.com/cssref/pr_class_position.asp
Upvotes: 1