![]() If your image is landscape, and your container is portrait, you must set width=”100%” on the image.If your image is portrait, and your container is landscape, you must set height=”100%” on the image.If your image and container are both “ portrait shaped” or both “ landscape shaped” (taller than they are wide, or wider than they are tall, respectively), then it doesn’t matter which of height or width are “%100“.Choosing whether to do height or width depends on your image and container dimensions:.If you set both to “100%”, your image will be stretched.To resize an image proportionally, you have to set either the height or width to “100%”, but not both.Warning, exiting browser-side territory!.Using the STYLE attribute within the IMG tag to manually set the width or height for each image (essentially the same as #1).Two different CSS classes (one for width, one for height).Three ways to resize images to fit a DIV :
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |