dev@jsftemplating.java.net

Re: JSFTemplating: HTML appears differently on my computer than live

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Mon, 12 Nov 2007 22:43:34 -0800

If you take a look at site.css, I added a comment where I needed to
specify the "bodycol" id in order for my css rules to override the ones
in tigris.css and inst.css. Here are the diffs:

-.tutorial a:link, .tutorial a:visited {
+/* Need bodycol in order to override inst.css and tigris.css
declarations */
+.tutorial a:link, .tutorial a:visited, #bodycol .tutorial a:link,
#bodycol .tutorial a:visited {
        text-decoration: underline;
 }

The lines starting with minus (-) is the old entry that didn't work b/c
it wasn't specific enough. The new one is the same + it includes 2 new
rules which each include the "#bodycol" reference which specifics that
it should apply to elements inside an HTML element w/ an id of
"bodycol". If you look in tigris.css and inst.css you'll find that each
of them also include this... but because I also have "tutorial" and
because I am writing these rules in the page, my rules will now "win."

As for tools... "firebug" (http://www.getfirebug.com) is a good general
HTML tool. It can help with JS, CSS, and plain HTML. You can edit
pages on the fly, view their css rules, etc. However, I am not 100%
happy w/ how it shows where a CSS rule comes from (it doesn't). There
are some other plugins for Firefox that also help w/ css... let me know
if you find a good one. :) Also, many editors will do syntax
highlighting for .css files (as well as java, js, html, etc.). This can
help find errors quickly... that's how I found the typos that you had.
I use vim (http://www.vim.org), but I only recommend it if you are (or
want to become) a "vi" expert. :) I'm sure NetBeans and other editors
do the same.

Good luck!

Ken

Michael Phoenix wrote:
> Ken,
>
> Can you be a littl more specific as to what you did here? I noticed
> that you didn't add component id to site.css? Did you add it to each
> page incividually? Where exactly?
>
> Mike
>
> On Nov 12, 2007 2:18 PM, Ken Paulsen <Ken.Paulsen_at_sun.com
> <mailto:Ken.Paulsen_at_sun.com>> wrote:
>
>
>
>
> * However, even if the above css was written correctly (and I
> suspect it was on the local machine or at some point), it wouldn't
> have mattered. The tigris.css and inst.css files had rules that
> took precedence because the specified an ID of a component in
> their declaration. I added the ID to our rules to fix this.
>
> Ken
>
>
>