Current location: Hot Scripts Forums » General Web Coding » CSS » css autoheight issue


css autoheight issue

Reply
  #1 (permalink)  
Old 06-23-06, 05:35 PM
Rollo Tamasi Rollo Tamasi is offline
Newbie Coder
 
Join Date: Jun 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
css autoheight issue

Hi,
I have a div which contains a background image. Within that div i want to place a few more divs which will contain images. The problem i'm having at the moment is that when i add images to the divs, the main div does not adjust it's height to fit them in. So i have an overlapping div.

This is the css for the larger div
Code:

Code:
#Layer9 
{ position: absolute;
left: 98px; 
top: 344px; 
width: 771px;
height: 600px; 
z-index: 9;
 background-image: url(blue_layout_imgready_09.gif);
 background-repeat: repeat-x; margin: 0px; padding: 0px;


and this is a sample of the inner divs
Code:
Code:
#Layer24
 { 
position:absolute;
width:1px; 
height:auto;
 z-index:2;
 left: 460px; 
top: 236px;
 background-image: url(advert_border.gif);
}
I wouldn't be too much of an CSS expert so the problem is probably easily resolved. Thanks
Reply With Quote

Last edited by Rollo Tamasi; 06-23-06 at 05:39 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-01-06, 05:24 AM
Clark_Kent's Avatar
Clark_Kent Clark_Kent is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Rollo Tamasi,

As far as i know, i dont think you'll be able to autoresize divs using css only. I'm not completely clear as to why you would want the main div to autoresize, whenever positioning images using divs i always use tables to house my divs... but perhaps this site could help you out. It's got some great css examples that could help you achieve what you are trying to achieve.

Hope this helps.

- CK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-05-06, 12:11 AM
jfulton's Avatar
jfulton jfulton is offline
Community VIP
 
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
If you explicitly set the height or width of a div, it should not automatically resize based upon overflow. IE does do this though. Check http://www.positioniseverything.net/...ingboxbug.html.

I think your problem is that you are using background images and expecting the div to expand based upon the dimensions of the background image. That is not going to happen. The background image is not content, therefore the div will not expand to show it all. If you know the dimensions of the background image, explicitly set the size of the "container" div.

Hopefully that will point you in the right direction.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS inspiration webzen CSS 3 03-05-08 03:47 AM
Cross-browser CSS Help Arctic CSS 10 12-26-06 12:21 PM
css issue darkcarnival CSS 4 10-11-05 09:35 PM
Issue Tracking and Task management SlackeR Script Requests 8 10-05-05 05:29 PM
Use of CSS within PHP CutAndPaste PHP 5 07-11-05 08:27 AM


All times are GMT -5. The time now is 12:20 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.