I'm trying to build a box that i can place content in. This box should dynamically change width and height to accommodate the content inside. I have build out a non-working example here http://sb.cesarvillaca.com/demo/box/box.php. It looks like i want it to be, but it doesn't work dynamically. Can someone please help me get this working, or show me an example i can work from online? Thanks.
Here is my html with php for height/width (non-dynamic) values
Here is my html with php for height/width (non-dynamic) values
Code:
<html> <head> <title> new document </title> <style type="text/css" title=""> #box_t_body { background-image:url('box_t_body.jpg'); background-repeat: repeat-x; height:11px; float:left; } #box_b_body { background-image:url('box_b_body.jpg'); background-repeat: repeat-x; height:11px; float:left; } #box_l_body { background-image:url('box_l_body.jpg'); background-repeat: repeat-y; float:left; } #box_r_body { background-image:url('box_r_body.jpg'); background-repeat: repeat-y; float:right; width:11px; } #box_tl_corner { background-image:url('box_tl_corner.jpg'); background-repeat: no-repeat; height:11px; width:11px; float:left; } #box_tr_corner { background-image:url('box_tr_corner.jpg'); background-repeat: no-repeat; height:11px; width:11px; float:right; } #box_bl_corner { background-image:url('box_bl_corner.jpg'); background-repeat: no-repeat; height:11px; width:11px; float:left; } #box_br_corner { background-image:url('box_br_corner.jpg'); background-repeat: no-repeat; height:11px; width:11px; float:right; } #box_body { background-color:#ffffff; float:left; } /* .clear prevents divs from flaotin gout side a container div. */ .clear{ height:0; font-size:0; line-height:0; clear:both; } </style> </head> <body> <?php $width=600; $height=600; ?> <div id="box_t_body" style="width:<?= $width ?>px;"><div id="box_tl_corner" style=""></div><div id="box_tr_corner" style=""></div></div> <br class="clear"> <div id="box_body" style="height:<?= $height ?>px;width:<?= $width ?>px;"> <div id="box_l_body" style="height:<?= $height ?>px; padding-left:20px;"> <div id="" class="" style="width:550px;">Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental: in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es.</div> </div> <div id="box_r_body" style="height:<?= $height ?>px;"></div> </div> <br class="clear"> <div id="box_b_body" style="width:<?= $width ?>px;"><div id="box_bl_corner" style=""></div><div id="box_br_corner" style=""></div></div><br class="clear"> </body> </html>
Comment