Go Back   I-Mockery Forum > I-Mockery Miscellaneous Forums > Questions, Suggestions, and Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Chojin Chojin is offline
was never good
Chojin's Avatar
Join Date: Apr 1999
Old Apr 20th, 2007, 07:23 PM        Is it possible to do this with CSS?
HEY THERE! I've been trucking about with PHP learnings and CSS goings-ons, and I've run into a problem. I want to take an image and have it display in a float in the LOWER-left of a dynamically-sized text box. My initial solution was to have PHP get the height of the image (X), then place it as a relative float after the textbox, then bump it up by X pixels (and by textbox, I mean a table that contains text included from a specified document).

However, this creates two problems-
1. The text is obscured by the image - it doesn't wrap around it like normal.
2. The vertical space taken up by where the image would have been if it wasn't bumped up by X pixels remains as blank space.

Because the contents and size of the textbox are variable, I need a dynamic solution and not a hack. Any ideas?

Code:
// This is the text
<?php include("reviews/" . $gameid . "_id_em.txt"); ?>

// If an image exists, paste it in the document
<? if (file_exists("fanart/" . $gameid . "_t01.jpg")) { ?>

// Get the image's dimensions and put them in variables
  <?php list($imgwidth, $imgheight, $imgtype, $imgattr) = getimagesize("fanart/" . $gameid . "_t01.jpg"); ?> 

// Place the image below the text and bump it up by the variables
  <div style="position:relative;top: -<?php echo $imgheight ?>px;">
  <img src="<?php echo "fanart/" . $gameid . "_t01.jpg" ?>" /></div>
<?php }; ?>
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

   


All times are GMT -4. The time now is 03:46 PM.


© 2008 I-Mockery.com
Powered by: vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.