|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Image resizing in a cell [CSS or HTML?]
I'm looking to do a site redesign. I'm a fan of being subtle, so I don't like to go overboard w/ graphics and the such. However, I have a pretty cool design idea that I'm throwing around [I still have a lot to do], and here is my current layout:
URL My problem is this: How do I have an image within a cell resize itself to fit inside the cell w/o having the cell resize to fit the image? For example, say if I have a 215x100 cell, and the image is 100x100, how would I get it so that it stretches to fit the cell? Also, at the same time, say if an image was 250x250, how would one go about having it so the image would resize to 215x100 [the size of the cell] instead of making the cell stretch? This is using tables, but I'd imagine this could be accomplished more smoothly w/ CSS. I was just wondering if it could be done w/ tables, if not how would I go about doing it in CSS? |
|
#2
|
||||
|
||||
|
If you are satisfied to compress and/or stretch the image, all that is needed is to use the width and height attributes for the img element. The same applies to using CSS. Just alter the syntax. The browser will distort it to fit.
(If you prefer that your image not be used for this demo, I will remove it.) If you want the image to maintain its aspect ratio, you will need to size and crop in your favorite (Gnu) image manipulation program. ![]() cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. Ask a better question, get a better answer. |
|
#3
|
||||
|
||||
|
Quote:
Say if I don't care if it stretches/compresses. I don't want to specify it to be 215 x 100, because on larger resolutions the images will remain small and not proportional to the rest of the page. Is there a way that I can have the images stretch to fit the size of the cell instead of making the cell too big? Quote:
It's cool. ![]() |
|
#4
|
|||
|
|||
|
i understood now what u said, but i still do not understand why u have this problem with resolution...
what u can do is, instead of making the table width 70%, change it to a fixed value in pixels. ahh, and another thing... plizzz... dont use frontpage... use dreamweaver! =) |
|
#5
|
||||
|
||||
|
OK. here's one more try
cheers, gary ps. Quote:
Last edited by kk5st : November 29th, 2003 at 11:21 PM. |
|
#6
|
|||
|
|||
|
Quote:
I used to just write the code in Notepad, I stopped doing it as making the overall layout via tables in a wysiwyg program cut down on redundant code writing. I might have to start doing it again though. ![]() Last edited by LookitsPuck : November 30th, 2003 at 07:23 PM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Image resizing in a cell [CSS or HTML?] |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|