Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - advice on images and CSS

 
Thread Tools Search this Thread
Old 09-21-2006, 03:58 PM   #1
Default advice on images and CSS


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
  Reply With Quote
Old 09-21-2006, 04:23 PM   #2
Andy Dingley
 
Posts: n/a
Default Re: advice on images and CSS


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).

  Reply With Quote
Old 09-21-2006, 08:31 PM   #3
richard
 
Posts: n/a
Default Re: advice on images and CSS


"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

  Reply With Quote
Old 09-21-2006, 10:00 PM   #4
mbstevens
 
Posts: n/a
Default Re: advice on images and CSS

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/


  Reply With Quote
Old 09-22-2006, 02:06 PM   #5
Wombatwal
 
Posts: n/a
Default Re: advice on images and CSS

Thanks all.
Bruce

"mbstevens" <> wrote in message
news m...
> 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/
>
>



  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump