| | |
Automagically resize images?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 632
Reputation:
Solved Threads: 46
Is there anyway to get images to be the "correct" size - i.e. fit the width of the text?
This is what currently happens:
http://engineeringnotes.net/personal/pictures.shtml
Thanks,
Dave
This is what currently happens:
http://engineeringnotes.net/personal/pictures.shtml
Thanks,
Dave
-1
#2 Oct 9th, 2009
those are the actual sizes of the images, not the desired size I just pulled the sizes off the smallest image, and resized the others by proportion 730*752 > 594*612
its not a good idea to use html to resize images to suit the layout
actually resize the images with Irfanview, paintshop etc,
and serve them the correct size, (still with the sizes specified in the xhtml) smaller images = faster load times
notes
1:: the layout sucks, fixed width central column may look good on your pc,
mine is 2400px wide, what a waste of space
Ems and % are the dimensions of choice, width will adjust to screen and window size, keeping the same proportion as your design screen, on a wider range of systems
2:: incidental; the only bugs in the code is the missing alt tags in those images
html Syntax (Toggle Plain Text)
<div id="main"> <h1>Pictures</h1> <img width='594' height='292' alt='alt text is a requirement' src="Pictures/3DIM_poster.jpg" /> Poster presentation at 3DIM 2009. <img width='594' height='612' alt='alt text is a requirement' src="Pictures/scanner_inside.jpg" /> Leica HDS3000 LiDAR scanner in the lab. <img width='594' height='612' alt='alt text is a requirement' src="Pictures/scanner_outside.jpg" />A day of scanning in Troy. </div>
its not a good idea to use html to resize images to suit the layout
actually resize the images with Irfanview, paintshop etc,
and serve them the correct size, (still with the sizes specified in the xhtml) smaller images = faster load times
notes
1:: the layout sucks, fixed width central column may look good on your pc,
mine is 2400px wide, what a waste of space
Ems and % are the dimensions of choice, width will adjust to screen and window size, keeping the same proportion as your design screen, on a wider range of systems
2:: incidental; the only bugs in the code is the missing alt tags in those images
Last edited by almostbob; Oct 9th, 2009 at 9:44 pm.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
1
#6 Oct 10th, 2009
•
•
•
•
Is there anyway to get images to be the "correct" size - i.e. fit the width of the text?
This is what currently happens:
http://engineeringnotes.net/personal/pictures.shtml
Thanks,
Dave
Add this line in your
CSS
HTML and CSS Syntax (Toggle Plain Text)
#main img {width:100%}
Last edited by Troy III; Oct 10th, 2009 at 4:25 pm.
![]() |
Similar Threads
- How to resize images (PHP)
- How to resize images at runtime using mouse... (VB.NET)
- Upload and Resize PNG and GIF images (PHP)
- Problem with uploading images to website (PHP)
- Indexing Images (PHP)
- Uploading entire directories of images using PHP (PHP)
- Reducing pixelization in images (ASP.NET)
Other Threads in the HTML and CSS Forum
- Previous Thread: how
- Next Thread: .htaccess redirect, and an anchor link
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl






