[SOLVED] Div not expanding to contain items inside

This is a discussion on "[SOLVED] Div not expanding to contain items inside" within the Web Page Design section. This forum, and the thread "[SOLVED] Div not expanding to contain items inside are both part of the Design Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Dec 5th, 2007, 14:52
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Div not expanding to contain items inside

Can any one help me with the CSS to make sure the container div expands to include all content. Sure it's a simple thing!

HTML as follows:
HTML: Select all
<div id="yglas_featuretwo"><span class="feature_headtwo">FOCUS ON</span> Working with animals<img class="left" src="../../_globalimages/enOnly/lin/car_photo.jpg" /></div>
CSS as follows:
Code: Select all
#yglas_featuretwo {width:270px; border-top:dotted 2px #006699;}
.feature_headtwo {color:#006699; font-weight:bold;}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 5th, 2007, 14:55
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div not expanding to contain items inside

Please post a link so we can see the complete site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 5th, 2007, 18:38
saltedm8's Avatar
SuperMember

SuperMember
Join Date: Nov 2005
Location: here
Age: 27
Posts: 1,521
Blog Entries: 2
Thanks: 1
Thanked 11 Times in 11 Posts
Re: Div not expanding to contain items inside

my best guess to what you want
HTML: Select all
<!--
#yglas_featuretwo {
    float:left;
    width:270px;
    border-top:dotted 2px #006699;
}

.feature_headtwo {color:#006699; font-weight:bold;
-->
</style>
</head>

<body>
<div id="yglas_featuretwo"><span class="feature_headtwo">FOCUS ON</span> Working with animals<img class="left" src="../../_globalimages/enOnly/lin/car_photo.jpg" /></div>
</body>
</html>
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 5th, 2007, 18:40
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div not expanding to contain items inside

I was thinking more

I have a wrapper and 2 floating divs but my border from my wrapper doesn't "wrap" around the floating div?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 6th, 2007, 12:29
Reputable Member
Join Date: Mar 2006
Location: UK
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div not expanding to contain items inside

Karinne, thanks!
The overflow:hidden propety works just fine.
I did try that yesterday at work and it didn't work but have just recreated the layout from scratch at home and no problem!
Are there any issues with the overflow:hidden property?
BTW The Webforumz newsletter is great, hadn't looked at it before.

Cheers
Snappy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Dec 6th, 2007, 12:37
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div not expanding to contain items inside

Quote:
Originally Posted by snappy View Post
Are there any issues with the overflow:hidden property?
Not that I know of ... or ... not one that I have encountered yet

Glad to see it worked
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 6th, 2007, 13:54
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: [SOLVED] Div not expanding to contain items inside

Personally, I would use { overflow: auto } instead, which has the exact same effect but would add a scrollbar if the content became hidden.

This is more a theoretical problem than a practical one, however.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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
[SOLVED] Links from inside swf to html pages Posie Flash & Multimedia Forum 6 Jan 3rd, 2008 22:02
[SOLVED] positioning something inside an image danny322 Web Page Design 3 Dec 5th, 2007 13:36
passing items to paypal dab42pat PHP Forum 5 Jun 16th, 2007 10:13
Animation for menu items David Blake Flash & Multimedia Forum 12 Jun 14th, 2007 00:54
[SOLVED] Using variables to determine where library items will appear Anonymous User Flash & Multimedia Forum 1 Feb 9th, 2005 14:30


All times are GMT. The time now is 14:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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