SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,209
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    controlling the size of a background image

    Code:
    <style>
    
    .bgImage
    {
        background-image: url(google.gif);
        background-repeat: no-repeat;
        width:500px;
        height:200px;
        background-color:cccccc
    }
    
     
    </style>
    
    <table>
      <tr>
        <td class='bgImage'>
    
    myText
    
        </td>
      </tr>
    </table>
    The code displays background image at http://dot.kr/test/25.htm


    I like to make the size of the image "google.gif" 500px * 200px.


    The following trial modification seems doesn' work.
    Code:
        background-image: url(google.gif width:500px height:200px);

  2. #2
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You cannot stretch a backround image, only position or tile it. Any image shouldn't be resizes by the browser anyway as it severely degrades image quality - even if you got your google logo image that big, it would look attrocious...

    It also seems strange you would want a table cell so large - a lot of space for one item of tabular data ................................

  3. #3
    SitePoint Zealot kimberlybarryd's Avatar
    Join Date
    Jan 2007
    Location
    Nova Scotia, Canada
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to stretch a 75px x 32px image to 500px x 200px.? As Centauri said it will not look good. You need to find a bigger image to size it to your specs. or redo the logo in photoshop or Illustrator.


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
  •