Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

div tramping

Posted on 2008-10-08
3
Medium Priority
?
143 Views
Last Modified: 2012-05-05
how i can specify div location in a way that one wont be over the other?

i mean for example i have already one image that have a specific location on the page
how i can insure that the other image that i will add wont run over?



this it the situation that i am trying to avoid:
<div style="position: absolute; top: 70px; left: 255px; width: 50px; height:20px;background-color: yellow;">
<img src=google.gif border=0>
</div>
<div style="position: absolute; top: 80px; left: 255px; width: 50px; height:20px;background-color: yellow;">
<img src=google.gif border=0>
</div>

Open in new window

0
Comment
Question by:Sasha-N
3 Comments
 
LVL 16

Accepted Solution

by:
rbudj earned 1000 total points
ID: 22671216
you would prevent this by using your absolute positioning.  absolute positioning will place the div exactly where you want it so if you dont want it overlapping, it wont.  as a beginner though, I would stay away from absolute positioning... you will end up with different layouts across different browsers.
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 1000 total points
ID: 22672163
I agree that using absolute positioning will cause this problem, so simply don't use it.  You can either use relative positioning, or if you don't need to specifically position the image, put in a <BR> or two between them, without any positioning specified, and that will guarantee your images will not conflict.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question