Jump to content

align image as middle


virtualadz

Recommended Posts

i want to align my image as middle in php, this is the code with alt <?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_GO); ?>now can i leave the width and height and make the code like this<?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_GO, IMAGE_ALIGN); ?>is the above code right, should i leave a blank space for width and height and will the browser understand it auto.and it's reference will look like this:define('IMAGE_ALIGN', 'middle');

Link to comment
Share on other sites

:) What are you doing actually? Define is for a PHP constant isn't it? But don't you want images in your html document centered or vertically aligned?There isn't even a function called "tep_image"? :) Is that a user defined function? Edited by Dan The Prof
Link to comment
Share on other sites

well, i dont know what you are talking, i have all my images set to like this right from the start and it works.now suppose if i want a image with alt, width, height , it would be<?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_ALT, IMAGE_WIDTH, IMAGE_HEIGHT); ?>i want to have the align=middle attribute, i do i have that, is the below code right<?php echo tep_image(DIR_WS_IMAGES . 'next.gif', IMAGE_ALT, IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_ALIGN); ?>

Link to comment
Share on other sites

I don't know what you are doing, but this is an image:

<div style="width:100%; text-align:right"><img src="next.gif" alt="click here to go to next page" width="200" height="50" /></div>

What you are doing is printing the same but with loads of PHP constants, why?

Edited by Dan The Prof
Link to comment
Share on other sites

We can't know if the code is right, what can be done with those constants and that function unless we see it. Look for the constants where they are defined and the tep_image() function, and post them.

Link to comment
Share on other sites

ok i am searching for that, when i find it will post here, in the meantime can you take a look at what's wrong with this<a href="#top"><?php echo tep_image(DIR_WS_IMAGES . 'top.gif'); ?></a>igonore the image, just look at the anchor link, it's not showing up correctlywww.site.com/folder/file.phpit should make a link to go to the top for this page, but instead shows thiswww.site.com/#top

Link to comment
Share on other sites

ok i am searching for that, when i find it will post here, in the meantime can you take a look at what's wrong with this<a href="#top"><?php echo tep_image(DIR_WS_IMAGES . 'top.gif'); ?></a>igonore the image, just look at the anchor link, it's not showing up correctlywww.site.com/folder/file.phpit should make a link to go to the top for this page, but instead shows thiswww.site.com/#top

Then you should try this:
<a href="/folder/file.php#top"><?php echo tep_image(DIR_WS_IMAGES . 'top.gif'); ?></a>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...