Results 1 to 3 of 3

Thread: HTML/CSS Image Scale

  1. #1
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default HTML/CSS Image Scale

    Okay, I got my template almost finished, but im working on something and need some help.
    The template automatically scales itself according to the screen resolution (credits for this to code841) but now i have a image that is suppose to scale all the way across the little post table/thing.
    Like go to neehosoft.com, you see where the posts are?
    I want a image to scale all the way (width) of it, but without having a set value because it changes for all screes res. please help,
    NeehoSoft.
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  2. #2
    Join Date
    Aug 2008
    Location
    Canada
    Posts
    67
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just a few things I would like to make sure I understand...
    1) Do you want the image to stretch only horizontally, or do
    you want it to scale properly?
    2) Is javascript an option, or would you prefer to stay away
    from it?
    3) I'm assuming its the logo that you want to be stretched?

    Edit:
    I have been playing around in Dreamweaver, and it seems all
    you really need to do is set the pictures width to 100%.
    This will cause cause the picture to expand while the
    "container" expands.

    I have not tested it out in any browser other then IE 8.

    I have attached the files I was playing around with,
    hopefully it helps you out a bit.

    If you still need help, just post a reply and I will "grab" a
    copy of your homepage and play around with the HTML until
    I get something that works.
    Last edited by The_Scripts; 11-15-2009 at 05:47 AM.

  3. #3
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    just put <img src="http://www." alt="" width="100%" />

    The 100% will make the image as width as it can be in the div it's in.

    Though it's an ugly solution imo. You could better just use a centered image and give the div it's in the same background color.

    For example:

    HTML Code:
    <!-- this in your head -->
    <style type="text/css">
      #header{
        background: #000000;
        text-align: center;
      }
    </style><!-- ect -->
    
    <!-- this in your body where te banner should be -->
    <div id="header">
      <img src="images/banner.gif" alt="website banner" />
    </div>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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