Solved

div tramping

Posted on 2008-10-08
3
135 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 250 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to dynamically set the form action using jQuery.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now