Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH)

This is a discussion on "Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH)" within the Web Page Design section. This forum, and the thread "Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH) are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 6th, 2008, 15:15
New Member
Join Date: Jan 2008
Location: Manchester, UK
Age: 27
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH)

Hiya guys,

i am not sure if this is the best way to do this, but this is what I am trying to do:

I have three columns in a wrapper div called "templateContent3".
  1. The second column just contains text content
  2. And the third column contains a relatively positioned div.
  3. The first column contains a relative div that has a nested absolute div inside of it. This renders perfectly in FF/IE7 but not in IE6.
My HTML is:
Code: Select all
<div id="templateContent3">
                <div id="col1">
                    <h5>My heading
                    </h5>
                    <img src="/images/h5-secondary4.gif" />
                    <ol>
                        <li><a href="#">Link</a></li>
                    </ol>
                    
                
                    <div id="postcardGlassesHolder">
                        <div id="postcardGlasses">
                            <!--<img src="/images/glasses-postcard.png" alt="Sun glasses and postcard" />  -->
                        </div>
                    </div>
                    
                </div>
   
                <div id="col2">
                    <h1 class="main">My other heading</h1>
                 
                    
                        <p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.  Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>                    
                        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.  Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>

                </div>
   

                <div id="col3">
                    <img src="/images/BritishIsles.png" alt="British Isles" class="BritishIsles" />
                    
                    
                    <form method="post" action="#" id="Locator" name="Locator">
                        <label for="region">Select your region</label>
                        <select name="region" id="region">
                            <option value="1" selected="selected">Region</option>
                        </select><br />
                        
                        <label for="town">Select your town</label>
                        <select name="town" id="town">
                            <option value="2" selected="selected">Town</option>
                        </select>
                        
                        <input type="submit" name="SubmitRegionTown" id="SubmitRegionTown" value="Submit" />
                    </form>
              </div>
            </div>
My CSS is:
Code: Select all
body#wideTemplateStyle1 div#templateContent3 div#col1{width:200px;float: left;margin: -5px 0 0 10px;padding:0;}
body#wideTemplateStyle1 div#templateContent3 div#col1 div#postcardGlassesHolder{
    position: relative;
    top: -200px;
    width:1250px;
}

body#wideTemplateStyle1 div#templateContent3 div#col1 div#postcardGlasses{
    width: 800px;
    height: 666px;
    background-image: url(/images/glasses-postcard.png);
    background-position: center left;
    background-repeat: no-repeat;
    position: absolute;
    top: 200px;
    right: 1050px;    
}


body#wideTemplateStyle1 div#templateContent3 div#col1 ol li{

background-image: url(/images/dottedIE6.gif);
background-position: bottom;
background-repeat: repeat-x;
width: 190px;
font-size: 1em;
line-height: 220%;
font-weight: normal;
text-indent: 10px;
}

body#wideTemplateStyle1 div#templateContent3 div#col1 ol li a {
color: #4D4D4D;
background-color: transparent;
}

body#wideTemplateStyle1 div#templateContent3 div#col2{
width:350px;
float: left;
margin: 0 10px;
}

body#wideTemplateStyle1 div#templateContent3 div#col2 p{
font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 1.15em;
line-height: 150%;
margin: 20px 0;
color: #4D4D4D; 
background-color: transparent;
}

body#wideTemplateStyle1 div#templateContent3 div#col3{
width:800px;
height: 571px;
background-image: url(/images/postcard.png);
background-position: top;
background-repeat: no-repeat;
position: relative;
left: 570px;
padding: 85px 0 0 0;
}

body#wideTemplateStyle1 div#templateContent3 div#col3 img.BritishIsles{
    position: relative;
    top:0;
    right: 500px;
}

body#wideTemplateStyle1 div#templateContent3 div#col3 form#Locator {
width: 250px;
margin: 20px 0 0 35px;
}

body#wideTemplateStyle1 div#templateContent3 div#col3 form#Locator select{
width: 140px;
clear:both;
margin: 0 0 0 22px;
border: 1px inset #4D4D4D;
background-color: #E0E0E0;
color: #4D4D4D;
font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 1.1em;
padding: 1px;
}

body#wideTemplateStyle1 div#templateContent3 div#col3 form#Locator label{
width: 230px;
display:block;
clear:both;
margin:2px 0 2px 22px;
color: #243F8A;
font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 1.1em;
}

body#wideTemplateStyle1 div#templateContent3 div#col3 form#Locator input#SubmitRegionTown
{
width: 60px;
color:#000;
background-color: #E4CA42;
border: 1px solid #868686;
padding: 1px;
font-size: 1.1em;
font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif;
}
Any ideas?

The catch 22 I have is I want to absolutely position the div "#postcardGlasses" to take it out of flow for where it needs to render, but I need to close up the space it leaves behind - hence relatively position the containing div "#postcardGlassesHolder".

Thanks in advance for this!
Reply With Quote

  #2 (permalink)  
Old Feb 6th, 2008, 17:18
saltedm8's Avatar
Lead Administrator

SuperMember
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,281
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
Re: Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH)

have a look here, is this it ?

not sure http://www.agum.com/web/2008/01/17/c...yout-property/
__________________
My Recipe forum...don't click here
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Reply With Quote
  #3 (permalink)  
Old Feb 7th, 2008, 08:08
New Member
Join Date: Jan 2008
Location: Manchester, UK
Age: 27
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH)

Cheers, saltedm8. I did have a look at: http://www.agum.com/web/2008/01/17/c...yout-property/

The fix in this article did not work for me, but after some trial and error experimentation, I created an IE6 conditional stylesheet with this style for the containing div of the absolutely position div...

Code: Select all
body#wideTemplateStyle1 div#templateContent3 div#col1 div#postcardGlassesHolder{position: absolute;top: 0;}
...instead of using a relative positioning that I used for more compliant browsers:

Code: Select all
body#wideTemplateStyle1 div#templateContent3 div#col1 div#postcardGlassesHolder{
    position: relative;
    top: -200px;
    width:1250px;
}
It seems to work. But I do not know why which is slightly annoying and probably means that the solution is incorrect and will break later on when the design in nearing finished.

But I guess for now I will have to accept to cross that bridge when I come to it!
Reply With Quote
  #4 (permalink)  
Old Feb 7th, 2008, 18:43
saltedm8's Avatar
Lead Administrator

SuperMember
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,281
Blog Entries: 1
Thanks: 1
Thanked 6 Times in 6 Posts
Re: Absolute Div, wrapped in Relative Div (IE6 - AARRRGGHH)

the great thing with css is that it is easy to fix if it messes up, glad to be of help
__________________
My Recipe forum...don't click here
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
When is it ok to use Absolute Positioning ?? slimboyfatz32 Web Page Design 31 Feb 6th, 2008 17:25
positioning - relative or absolute? google Web Page Design 13 Nov 8th, 2007 16:00
CSS Challenge... absolute AND relative positionning Trollivier Web Page Design 5 Feb 9th, 2007 16:41
loadMovie function (and absolute/relative URL's) DocBoy52 Flash & Multimedia Forum 1 Aug 26th, 2006 05:16
Absolute nOOb at this needs help! beatlesteve PHP Forum 1 Oct 13th, 2005 07:22


All times are GMT. The time now is 19:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43