SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Fluid Height of Images

    Hi,

    I have the following CSS code in which various width images are displayed in. The problem I have is that I can't fix the height as it will stretch the image. However without a height the image is squashed in certain browsers.

    Can anyone advise how to insert images and ensure they are squashed by various browsers?

    Code:
    .blogimage { 
       float:left;
       clear:both;
       width:60%;
    margin-left:20%;
    margin-right:20%;
    margin-bottom:1%;
    }

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,596
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by justlukeyou View Post
    Can anyone advise how to insert images and ensure they are squashed by various browsers?
    Not exactly sure what you mean... but... they won't squash.
    Code:
    img {width:100%; height:auto;}
    maybe?

  3. #3
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Cheers dude, that sorted it.

  4. #4
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,596
    Mentioned
    65 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by justlukeyou View Post
    Cheers dude, that sorted it.
    Cool. Thanks for the feedback.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •