2 replies [Last post]
Gasolene
Offline
newbie
Last seen: 16 years 41 weeks ago
Joined: 2004-02-14
Posts: 6
Points: 0

i have 2 nested div's

<div 'container'>
  <span>stuff</span>

  <div id='big box'>
      <h1>stretch me... ... ... ... ...</h1>
  </div>

</div>

I need the big box to stretch to an unknown width that is wider than the container without stretching the container.

The container cannot be any wider than is required to output the contents of the span tag.

the width of either of these div's is unknown

thnx,

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 5 days 6 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

big div inside little div

Hi Gasolene,
I would try positioning the inner div absolute or relative and give it a z-index.

Hope that helps

Gasolene
Offline
newbie
Last seen: 16 years 41 weeks ago
Joined: 2004-02-14
Posts: 6
Points: 0

big div inside little div

thnx,

i was able to get the div to expand beyond the parent div with position: absolute;

however, any div's inside the inner div 'big box', will not stretch to the width of big box when using netscape 7.

I can't get the two h1 tags in the inner div to be the same length without giving them an exact width.

<div 'container' style="position: relative;">
  <span>stuff</span>

  <div id='big box' style="position: absolute;">
      <h1 style="width: 100%;">stretch me... ... ... ... ...</h1>
      <h1 style="width: 100%;">smaller line</h1>
  </div>

</div> 

ie 6 works fine