Jump to content

[SOLVED] Div resize to image


FlyingIsFun1217

Recommended Posts

Hey!

 

I've got a CSS div that is used to hold the contents of my page. Sometimes though, I've got content that is too large for the div container, and it extends outward (out of the div). Is there any way to have it expand only with its contents?

 

Thanks!

FlyingIsFun1217

Link to comment
https://forums.phpfreaks.com/topic/109763-solved-div-resize-to-image/
Share on other sites

Ok, I've made it to automatically expand, but now the column next to it doesn't expand downward with it (I want them to always be the same height):

 

body
{
min-width:		800px;
width:			auto;
margin:			0%;
padding:		0%;
font-family:		georgia;
height:			auto;
}

div.boxSingle
{
padding:		5px;
background: 		#E4E3FE;
border:			1px solid #666581;
width:			100px;
font-family: 		georgia;
color: 			#47465A;
}

div.boxDouble
{
padding:		5px;
background:		#E4E3FE;
border:			1px solid #666581;
width:			200px;
font-family: 		georgia;
color: 			#47465A;
}

div.adminBox
{
padding:		5px;
background: 		#E4E3FE;
border:			1px solid #666581;
width:			40%;
font-family: 		georgia;
color: 			#47465A;
}

div.sidebarMenu
{
padding:		5px;
background:		#E4E3FE;
border:			1px solid #666581;
width:			95%;
font-family:		georgia;
color:			#47465A;
}

div.imageTitle
{
color:			#47465A;
text-decoration:	underline;
font-weight:		bold;
}

table.main
{
border-collapse:	collapse;
border-style:		solid solid solid solid;
border-width:		1px 1px 1px 1px;
padding:		0px 50px 50px 0px;
border-color:		#666581 #666581 #666581 #666581;
border-spacing:		10px;
background-color:	#E4E3FE;
}

table.main td
{
border-width:		1px 1px 1px 1px;
padding:		1px 25px 1px 25px;
border-style:		none none none none;
-moz-border-radius: 	0px 0px 0px 0px;
}

#header
{
background:		#ddd;
min-height:		100px;
max-height:		125px;
height:			17%;
text-align:		center;
text-decoration:	underline;
}

#header h1
{
margin:			0%;
}

#sidebar
{
float:			left;
width:			20%;
background:		#99c;
min-height:		500px;
height:			auto;
}

#container
{
float:			right;
width:			80%;
background:		#9c9;
min-height:		500px;
height:			auto;
}

#footer
{
clear:			both;
background:		#cc9;
height:			5%;
}

#footer p
{
margin:			0%;
padding:		10px;
background:		#ddd;
}

a:link
{
color: 			#4F6A90;
text-decoration: 	underline;
}

a:visited
{
color: 			#374A64;
text-decoration: 	underline;
}

a:active
{
color: 			#374A64;
text-decoration: 	underline;
}

a:hover
{
color: 			#374A64;
text-decoration: 	underline;
}

 

Thanks!

FlyingIsFun1217

The only problem with that technique is that I am using percentage-based widths for the 'columns', so if the window is resized, the width of the div will be at a different width of the background image...

 

Well, this is getting really... interesting...

 

FlyingIsFun1217

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.