www.webdeveloper.com
Results 1 to 5 of 5

Thread: Explicit <img tags

  1. #1
    Join Date
    Aug 2007
    Posts
    29

    Explicit <img tags

    The application loads several images of different sizes and from different locations
    Is there a method to set attributes so that they all appear with the same width and height dimensions without having to adjust each individually?

  2. #2
    Join Date
    Jul 2006
    Posts
    207
    Use CSS, or JavaScript to set the attributes.

    Code:
    img {
    width: 100px;
    height: 100px;
    }

  3. #3
    Join Date
    Aug 2007
    Posts
    29

    Explicit img attributes

    I have unsuccessfully tried in CSS

    HTML Code:
    .img src {
    width: 500px;
    height: 400px;
    }
    and div style

    HTML Code:
    <div id="galleryalt" class="paginationstyle" style="width: 500px; text-align: left">
    Trying to avoid having to edit dozens of images..

  4. #4
    Join Date
    Aug 2006
    Posts
    1,922
    Did you try the css Cory R suggested? That would work if I understand your request.

    Dave

  5. #5
    Join Date
    Nov 2010
    Location
    Los Angeles, CA
    Posts
    234
    Quote Originally Posted by dbldee View Post
    I have unsuccessfully tried in CSS

    HTML Code:
    .img src {
    width: 500px;
    height: 400px;
    }
    This is incorrect CSS. You don't need the "src", just this:
    HTML Code:
    .img {
    width: 500px;
    height: 400px;
    }
    But the better way is to use width and height attributes in your image tags as demonstrated here: http://www.w3schools.com/tags/att_img_width.asp

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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



Recent Articles