![]() |
|
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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). |
|
|
|
#3 |
|
Posts: n/a
|
"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 |
|
|
|
#4 |
|
Posts: n/a
|
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/ |
|
|
|
#5 |
|
Posts: n/a
|
Thanks all.
Bruce "mbstevens" <> wrote in message news > 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/ > > |
|