473,569 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wrapper div doesn't take into account rel pos of content div?

Seemingly simple problem. I have a wrapper div with a border. Inside
is a content div, which uses relative positioning to move it down a
bit from the top of the wrapper border -- I used positioning to avoid
the discrepancies between IE and Mozilla when it comes to
margins/padding. The problem is, now the content div breaks out of the
wrapper div -- the wrapper fails to grow to accomodate the positioned
content, and instead acts as though the content is still in its
default position. Is there a way to fix this?

Here's an example:

<style>
div.wrap{border :1px solid blue;width:300p x;}
div.content{bor der:1px solid
black;position: relative;top:50 px;left:50px;wi dth:200px}
</style>
<html>
<body>
<div class=wrap>
<div class=content>
test<br>
test<br>
test<br>
</div>
</div>
Jul 20 '05 #1
1 1886
Lister Monocle wrote:
I have a wrapper div with a border. Inside is a content div, which
uses relative positioning to move it down a bit from the top of the
wrapper border -- I used positioning to avoid the discrepancies
between IE and Mozilla when it comes to margins/padding.
You'd be better off accepting that there might be differences in margins
in different browsers.
The problem is, now the content div breaks out of the wrapper div --
the wrapper fails to grow to accomodate the positioned content, and
instead acts as though the content is still in its default position.
That sounds like correct behavior, unless I'm missing something.
Position: relative means adjust the position of that element without
reflowing the page.
Is there a way to fix this?
Since nothing is broken, no. You need margins here. If you're having
trouble with that, reply here with details.

Here's an example:

[snip]

Please provide a url, not pasted-in code. Preferably a simplified test
case. With valid code.

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1749
by: Support | last post by:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Word.Document> <meta name=Generator...
15
3801
by: Steve Richfield | last post by:
To All, First, some of your replies to me have been posted through DevelopersDex, and these are NOT posted on USENET for the world to see. DevelopersDex appears to be trying to hijack USENET, though there may be some more benign explanation that escapes me. If you want the world to see your replies, then you should post them directly to...
2
2279
by: John Mullin | last post by:
We are having a problem which appears similar to a previous posting: http://groups.google.com/groups?hl=en&lr=&frame=right&th=d97f552e10f8c94c&seekm=OZw33z9EDHA.2312%40TK2MSFTNGP10.phx.gbl#link1 In the current release of our system, we decided to "wrap" the ASP.NET Session and Application objects to improve code clarity and accuracy. For...
4
1747
by: Gary Bond | last post by:
Hi All, Can anybody point me to some 'how-to' documentation, tutorials, etc as to how to write a shrink/protect wrapper for .Net exes/dlls, (like the Shrinkwrap product for instance). I have got a couple of products nearly ready for sale, and have already come up with some routines to protect them, (in the style of the old TurboPower...
22
2490
by: linwu02 | last post by:
I am trying to write a Wrapper for our web wrapping engine, Cameleon. Currently Cameleon is able to answer certain SQL queries but with a restriction that all SQL queries must have a predicate. This is very similar to the BLAST wrapper. For example, Cameleon can answer queries like this by accessing Yahoo's IBM finance webpage Select...
7
10386
by: Justin Koivisto | last post by:
system: php 4.4.2 windows 2003 server apache 1.3.x problem: scripts don't work :-P description:
2
3087
by: GinTon | last post by:
EyeDB is a free ODBMS based on the ODMG 3 specification with programming interfaces for C++ and Java. It is very powerfull, mature, safe and stable. In fact, it was developed in 1992 for the Genome View project althought rewritten in 1994, and has been used in a lot of bioinformatics projects http://www.eyedb.org/ Python does not have...
5
7876
by: Bob Imperial | last post by:
Hi folks! In need of some enlightenment here, I'm trying to get my wrapper div to expand to accommodate height-wise, to whatever content is placed in it, no luck yet and I realize it's probably something simple, I just don't see it yet. I have the following: <div style="width:600px; border:1px solid #999933;"><!-- wrapper --> <div...
3
689
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response per their MSDN policy. -------------------- I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The web...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.