Jump to content

css class php picture


angelsofpromise

Recommended Posts

hi i've got this picture

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT,  'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>



i would like to set a class so i can use some css on this picture but i dont know how to add a class in php thanks ahead of time. i need the code to have class="reflect" in the image tag when the html compiles.
Link to comment
https://forums.phpfreaks.com/topic/36419-css-class-php-picture/
Share on other sites

Modify the tep_image function, or send the results to a string and modify them.

[code=php:0]
$imagecode = tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT,  'hspace="5" vspace="5"');
$imagecode = str_replace("<img", "<img class=\"reflect\"", $imagecode);
[/code]
Link to comment
https://forums.phpfreaks.com/topic/36419-css-class-php-picture/#findComment-173424
Share on other sites

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.