JRS: In article <11************ *********@b28g2 000cwb.googlegr oups.com>,
dated Sat, 15 Jul 2006 07:15:02 remote, seen in
news:comp.lang. javascript,
vi********@gmai l.com posted :
>Have a FAQ page , where have many sets of questions and answers. The
questions need to be a different colour / style and the answers
different. Was wondering is there a easy way to do this as compared to
enclosing each question and answer within divs ? Perhaps , through
JavaScript.
Use a Definition List, and have in the Head something like :
<style type="text/css"><!--
dl { background:lime ; padding:0.7ex; margin:0.5ex;}
dt { background:#FFe 4FF; padding:0.7ex; margin:0.5ex;}
dd { background:#CCF FFF; padding:0.5ex;}
--></style>
You'll be enclosing the questions and answers somehow anyway, so that
they are separated : you can apply styles to whatever you use. You
could logically make the questions Headings, and colour those thus.
See <URL:http://www.merlyn.demo n.co.uk/datecalc.htmof today or later.
You can use an external CSS file.
AIUI you could also get javascript, in an external file, to scan each
page onload and set styles where needed; but that seems unnecessary.
*** DO NOT MULTI-POST ***
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/>? JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.