You are here: Re: advice on images and CSS « HTML « IT news, forums, messages
Re: advice on images and CSS

Posted by Andy Dingley on 09/21/06 15:23

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация