Reply to Re: inherited styles

Your name:

Reply:


Posted by Toby Inkster on 03/09/06 22:32

jb wrote:

> Can another style be created which inherits border_color in its entirety?

Nope -- not the way you mean. CSS inheritance works differently from
object-oriented inheritance.

If you want to reuse colours and other styles over several different
classes, you might want to look into using a server-side scripting
language to serve your CSS.

e.g.

<?php
header("Content-Type: text/css");
$headingHighlight = '#ccffcc';
$normalForeground = '#006600';
?>
H1 {
border-left: 0.67em solid <?=$headingHighlight?>;
border-bottom: 2px solid <?=$headingHighlight?>;
padding: 0.25em;
}
H2 {
background: <?=$headingHighlight?>;
color: <?=$normalForeground?>;
padding: 0.25em;
}

and so on.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

[Back to original 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

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