Welcome visitor
* Login
* Register
It is currently November 18th, 2019, 5:49 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 6 posts ] 
Author Message
  Use of Images on a Html page
PostPosted: February 3rd, 2009, 9:17 pm 
User avatar

Posts: 52
So... I can place an image on my .htm document, but it is too big, is there any way to resize it, and also, is there any option so I can use it as a link or something? if so, how can I do that?


Top
 Profile  
 
  Re: Use of Images on a Html page
PostPosted: February 3rd, 2009, 9:36 pm 
User avatar

Posts: 112
Yes, and yes. If you want to modify the size of your image file you should only add the width property on the same <img /> tab, lets say

<img src="" width="50%">


On that case the percentage is according to the screen, not the file size. Or duing the same but with pixels,

<img src="" width="50px">


You can do the same with the height, or both together.

<img src="" height="50px" width="200px">


The thing is that if you only modify one, wether it be height or width, ther other will automatically change to keep the ratio.


Last edited by plug_n_play on February 3rd, 2009, 9:50 pm, edited 2 times in total.

Top
 Profile  
 
  Re: Use of Images on a Html page
PostPosted: February 3rd, 2009, 9:40 pm 
User avatar

Posts: 112
Sorry, I forgot about the link thing. It is pretty easy, you only need to place the image between the <a href> and the </a> tags, just like this:

<a href=""><img src=""></a>


Top
 Profile  
 
  Re: Use of Images on a Html page
PostPosted: February 5th, 2009, 7:48 pm 
User avatar

Posts: 52
Thanks for your help so far!! Now i need help to create a photo gallery using iframes, :D .

What im doing is use an iframe that shows all the thumbnails, each one being a link that shows in full size the same picture in another iframe. Now, i've figured it out the most part of it, but what i would like to do is have a horizontal scroll instead of the vertical one, any suggestions?? thanks guys!! :P


Top
 Profile  
 
  Re: Use of Images on a Html page
PostPosted: February 5th, 2009, 8:16 pm 

Posts: 117
Hum, I dont know what code you are using to place your images, so Im not going to mess with it. Just let me suggest you to put that code as if it were filling a table, throwing all the thumbanails on a same cell and that ought do it. This is what i would use, combining PHP and MySQL.
echo '<table border="0" cellpadding="0" cellspacing="0">

         <tr>';   
while ($resultantRow= mysql_fetch_array($db_tabla))
  {
   extract($resultantRow);       
   echo '<td><a href="/*file for the big-picture*/'" target="bigIframe"><img src="/*file for the thumbnail*/" /></a></td>';
   }
echo '</tr></table>';


Top
 Profile  
 
  Re: Use of Images on a Html page
PostPosted: February 5th, 2009, 8:21 pm 
User avatar

Posts: 52
thanks again!! it works really good, thanks! :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron