Solved

div tramping

Posted on 2008-10-08
3
139 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

729 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