CSS image shrink!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jollywg
    New Member
    • Mar 2008
    • 158

    CSS image shrink!

    I'm trying to "shrink" an image down to size so that my border will fit around it instead of just the top left corner. Any ideas?

    Thanks in advance!
    Matt
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    There are several ways to do this I suggest one of the following.

    1) You can use an image editing software to shrink the image. I recommend GIMP .

    2) Use CSS to adjust the width and height of your image.

    If you are using the image as a background image you would have to use the first option. If this doesn't help or you would like an example please post the code you are currently using, and I would be glad to help.

    Thanks,
    {\_/}
    (' . ')
    (")[DEATH](")
    (")(")

    Comment

    • Jollywg
      New Member
      • Mar 2008
      • 158

      #3
      Code:
      			#Info1 {width: 300px;
      				float: left;
      				height: 12em;
      				position: normal;
      				font-family: arial, sans-serif; 
      				color: black;
      				font-size: .9em;
      				padding-bottom: .5em;
      				text-align: left;
      				border: ridge;
      				border-width: .5em;
      				border-color:  rgb(255,100,0);
      				background-color: transparent;
      				background-image: url("CBTGroup.jpg");
      				background-size: 50%;}
      Here is the chunk of code that is dealing with the image. I've tried using height and width set at 50px each where the background-size is used, but didn't seem to work?

      Thanks

      Comment

      • Death Slaught
        Top Contributor
        • Aug 2007
        • 1137

        #4
        Images are inline elements and while using percentages with the background-size property, it will only work on block-level elements. For more information and examples on using the background-size property click here.

        Thanks,
        {\_/}
        (' . ')
        (")[DEATH](")
        (")(")

        Comment

        • Jollywg
          New Member
          • Mar 2008
          • 158

          #5
          I typed in display: block; and it worked like a charm!

          Thanks Death Slaught!!

          Comment

          Working...