advice on images and CSS

Discussion in 'HTML' started by Wombatwal, Sep 21, 2006.

  1. Wombatwal

    Wombatwal Guest

    G'day all
    I am putting together a family history web site. I have a few pages with a
    number of images on each. The images are different dimensions, some are
    portrait and others landscape.
    To lay them out with a style should I use in line style sheet or go for a
    external style sheet.
    I ask this because each image will be styled individually because of their
    differences.
    Thanks

    --
    Bruce
    Wombatwal, Sep 21, 2006
    #1
    1. Advertising

  2. Wombatwal

    Andy Dingley Guest

    Wombatwal wrote:

    > To lay them out with a style should I use in line style sheet or go for a
    > external style sheet.


    External, with a style attribute on each <img>/<div> around it. Put
    everything you can in the external stylesheet (including a reasonable
    default size), sizes and put any varying part into the attributes.

    For anything with common groups ("relatives in Australia", "the black
    sheep we don't talk about") then use relevant classes and styles in the
    stylesheet. Remember that you can apply multiple classes to the same
    element (space-separated in the same class attribute)

    The alternative is a vast number of #id values linking everything
    together. Although we have a general rule that "stylesheets are better
    practice than style attributes", it breaks down in this case. Where the
    scope of a style rule really is this narrow (and is going to stay that
    way) then there's no problem in sticking it directly onto the HTML.

    If you have more than two, maybe three style rules in one of these
    style attributes, then there's something wrong. In particular you
    shouldn't need to set the size of both nested elements (such as an
    <img> and a <div> for a border).
    Andy Dingley, Sep 21, 2006
    #2
    1. Advertising

  3. Wombatwal

    richard Guest

    "Wombatwal" <> wrote in message
    news:bMxQg.33357$...
    > G'day all
    > I am putting together a family history web site. I have a few pages with a
    > number of images on each. The images are different dimensions, some are
    > portrait and others landscape.
    > To lay them out with a style should I use in line style sheet or go for a
    > external style sheet.
    > I ask this because each image will be styled individually because of their
    > differences.
    > Thanks


    To do something of that nature, I would take the time to resize like images
    to be the same dimensions.
    Don't rely on the coding to resize them for you.
    Such as all landscapes being like 400x320.
    Even portraits would have at least a height of 400, then leaving the width
    to be determined by the image itself.
    Irfanview has a good batch program to do resizing fairly simply.
    www.irfanview.com
    richard, Sep 21, 2006
    #3
  4. Wombatwal

    mbstevens Guest

    On Thu, 21 Sep 2006 14:58:15 +0000, Wombatwal wrote:

    > To lay them out with a style should I use in line style sheet or go for a
    > external style sheet.


    External style sheets are usually best. Height and width can be in the
    markup, though. This *may* mean that you don't really need a different
    style for each image.

    > I ask this because each image will be styled individually because of their
    > differences.


    If you _really_ do need different styles, make up some image classes, one
    of which will fit any image in the site. If that is not enough, then
    in-line styles may be required, but it is hard for me to imagine a site
    that would _really_ need this.

    --
    mbstevens
    http://www.mbstevens.com/howtothumb/
    mbstevens, Sep 21, 2006
    #4
  5. Wombatwal

    Wombatwal Guest

    Thanks all.
    Bruce

    "mbstevens" <> wrote in message
    news:p...
    > On Thu, 21 Sep 2006 14:58:15 +0000, Wombatwal wrote:
    >
    >> To lay them out with a style should I use in line style sheet or go for a
    >> external style sheet.

    >
    > External style sheets are usually best. Height and width can be in the
    > markup, though. This *may* mean that you don't really need a different
    > style for each image.
    >
    >> I ask this because each image will be styled individually because of
    >> their
    >> differences.

    >
    > If you _really_ do need different styles, make up some image classes, one
    > of which will fit any image in the site. If that is not enough, then
    > in-line styles may be required, but it is hard for me to imagine a site
    > that would _really_ need this.
    >
    > --
    > mbstevens
    > http://www.mbstevens.com/howtothumb/
    >
    >
    Wombatwal, Sep 22, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Asun Friere
    Replies:
    1
    Views:
    497
    Paul Boddie
    Aug 27, 2003
  2. Peter Hansen
    Replies:
    23
    Views:
    869
    Anton Vredegoor
    Sep 5, 2003
  3. Gerrit Holl
    Replies:
    16
    Views:
    616
    Tom Plunket
    Aug 29, 2003
  4. Asun Friere
    Replies:
    0
    Views:
    479
    Asun Friere
    Aug 28, 2003
  5. Michele Simionato
    Replies:
    2
    Views:
    385
    Jacek Generowicz
    Sep 1, 2003
Loading...

Share This Page