472,952 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

DIV overlapping

3
The div is overlapping the H2 tag. Why?
The adspace may or may not be there... so I cant explicitly set the width of the H2. It should fill up the space available. Thanks

[PHP]<div id="adSpace" style="display:block;float:right;width: 160px; height: 500px; border: 1px solid green;">
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
</div>

<h2 style="border: 1px solid blue; background: #9A2A3A; ">
This is a title
</h2>
[/PHP]
Sep 4 '07 #1
5 1988
drhowarddrfine
7,435 Expert 4TB
You have to remember that when you float an element, that element is removed from the normal flow and that is why they are overlapping.
Sep 4 '07 #2
jzeil
3
so how would i fix this?

If you place an HR tag after the H2 you will see how I would like for the H2 to span.
Sep 4 '07 #3
drhowarddrfine
7,435 Expert 4TB
The easiest is to just put the ad div after the h2 and float it right like you are. This may still depend on what content would be displayed to the left of it.

I have a dentist appointment right now so I have to leave.
Sep 4 '07 #4
jzeil
3
naw still doesnt solve it. The code I posted is the root of the problem. The problem exists in a bigger document. There will be H2s above and below the ad. The ad wont always appear either.
Sep 4 '07 #5
drhowarddrfine
7,435 Expert 4TB
Something like this:
[HTML]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title></title>

<style type="text/css">

h2{background: #9A2A3A;}
#outer{
position:relative;
overflow:auto
}
#adSpace{
float:right;
width:160px;
height:500px;

}
</style>
</head>

<body>

<h2>
This is a title
</h2>
<div id="outer">
<div id="adSpace">
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here. Ad goes here.
</div>
</div>
<h2>
This is a title
</h2>

</body>
</html>[/HTML]
Sep 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: km | last post by:
Hi all, python re module deals with only nonoverlapping matches. how to go for if i want to find out overlapping matches and their span ? regards, KM
1
by: André Søreng | last post by:
With the re/sre module included with Python 2.4: pattern = "(?P<id1>avi)|(?P<id2>avi|mp3)" string2match = "some string with avi in it" matches = re.finditer(pattern, string2match) .......
11
by: Max M | last post by:
I am writing a "find-free-time" function for a calendar. There are a lot of time spans with start end times, some overlapping, some not. To find the free time spans, I first need to convert the...
3
by: Phil Sandler | last post by:
All, I have a table with start and end dates/times in it, and would like to be able to calculate the number of hours represented, accounting for overlapping records. Note that I am looking...
4
by: Simon Elliott | last post by:
Is there an equivalent of std::copy which works on STL containers for overlapping ranges? -- Simon Elliott http://www.ctsn.co.uk
0
by: Bruce | last post by:
Hello, Back in the Access 97 days, if I had two texboxes on a form or report that overlapped, and I selected both and did a Format, Align, Top from the menu in design view, the controls would...
4
by: David Thorp | last post by:
New to this list (first post), and relatively new to C, so hi everyone... If anyone can help me with this I'll be most grateful... The following code is from a rather elaborate (for me) program...
4
by: Charlie Brown | last post by:
I have a form with 2 custom controls that can be dragged around by a user. How can I check if they overlap each other without performing some kind of Collision detection on them? Is there...
4
by: =?ISO-8859-15?Q?Jean=2DFran=E7ois?= Lemaire | last post by:
Hello all, I'm learning C and I still am struggling to understand some basic concepts. For example, I read in the standard that with functions such as strcpy, 'If copying takes place between...
3
by: cowboyrocks2009 | last post by:
Hi, I am trying to write a Java program to plot rectangles with different colors side by side non overlapping but unfortunately I am unable to do that as of now. Suppose I want to create 3...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.