Go Back   I-Mockery Forum > I-Mockery Miscellaneous Forums > Questions, Suggestions, and Tech Support > Is it possible to do this with CSS?
FAQ Members List Calendar Today's Posts

Thread: Is it possible to do this with CSS? Reply to Thread
Title:
Message
Image Verification
Please enter the six letters or digits that appear in the image opposite.


Additional Options
Miscellaneous Options

Topic Review (Newest First)
Apr 20th, 2007 06:23 PM
Chojin
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 }; ?>

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

   


All times are GMT -4. The time now is 04:53 PM.


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