Centre Image

images php coding issues or problems here.

Moderators: macek, egami, gesf

DWillett
New php-forum User
New php-forum User
Posts: 22
Joined: Fri May 25, 2012 12:19 am

Centre Image

Postby DWillett » Thu Jun 21, 2012 10:30 am

Hi
Is it possible to centre the output image from this code?
The target is inner, can the code be edited to do this?

Regards

Code: Select all

//display images

foreach ($imgs as $img) {
    echo "<a href=\"$img\" target=\"inner\"><img src='$img' width=\"80\" border=\"1\"/></a> ";


}

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Centre Image

Postby egami » Thu Jun 21, 2012 11:59 am

<div style="text-align:center;"><a href="myimage.jpg"><img src="myimage.jpg" /></a></div>

Gurinder19904456
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Jun 25, 2012 10:29 pm

Re: Centre Image

Postby Gurinder19904456 » Mon Jun 25, 2012 10:32 pm

YOu <a href="http://gurindersinghdeveloper.blogspot.in/">need</a> to add an attribute "align='center'".

DWillett
New php-forum User
New php-forum User
Posts: 22
Joined: Fri May 25, 2012 12:19 am

Re: Centre Image

Postby DWillett » Wed Jun 27, 2012 5:44 am

Hi Guys

I don't think this is what I was after and difficult to explain. Here's a link to the web I'm working on where I can probably explain better:

http://www.mic-console.com/Image_Client/index.php

Use 200532 in the reference box.
Once in there you see links to pdf files in the left frame, that part works great.
If you click an image thumbnail the selected image shows frame section of the browser to the right, this is the part I wanted to improve. It would be great if the image opened in the right hand side but expanded to fill the section or at very least opened centralised.
Or is there another way to do this? I just want it to look better than it does now.

I hope someone can help?

Regards

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Centre Image

Postby johnj » Sun Jul 01, 2012 8:30 pm

In the right frame, you have placed the image within a <p> tag. Either you can change the alignment using the style (<p style="">) or follow what egami has advised - that should also work.

DWillett
New php-forum User
New php-forum User
Posts: 22
Joined: Fri May 25, 2012 12:19 am

Re: Centre Image

Postby DWillett » Mon Jul 02, 2012 2:33 am

Hi

Thanks for all the help guy's.
Every day is a learning curve for me.
I managed to achieve along the lines of how I wanted the page to look by using some other code.

( you get kinda hooked on this stuff - lol )

Thanks again guys.

Regards


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest