struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Ludington" <>
Subject Re: HELP:I've got a new problem when I tried to use struts-menu in my Tiles using display-tag.
Date Mon, 22 May 2006 02:33:20 GMT
You are not going to adjust the scope of a css file, but you will have
to change your HTML to give the browser some means of telling your two
tables apart, and then adjust your css accordingly.  Most often, this
is done by putting a class on the html, e.g. <td class="menuClass">.
Then, your css could be:

    td.menuClass {this style would only be applied to the menu td}
    td.displayTagClass {this style would only be applied to the display tag td}

I have not used either Struts-Menu or DisplayTag, so I do not know if
you can specify css classes to use in the HTML they generate.  I am
guessing that you can, but, even if you cannot, you can still apply
css to precise areas by containing them in other elements, and writing
your css accordingly.  Here is a quick example:

	table { font-family:arial,helvetica}
	#foo table { color:red}
	#bar table { color:green}
    <div id="foo">
            <tr><td>I am red arial</td></tr>
    <div id="bar">
            <tr><td>I am green arial</td></tr>

In this page, all tables are arial,hevetica, but only tables inside
the "foo" element are red, and only tables inside the "bar" element
are green.  You have to alter your HTML to give css knoweldge of where
to apply rules, and then change your css in ways like these so that
they only apply to the areas of the page that you need.  There are
other methods, as well, but a full discussion of css inheritance is
beyond the scope of this list, and probably my abilities as well :)

Here is a good link as a starting point:


On 5/21/06, M.Liang Liu <> wrote:
> Greg Ludington,you've got the point.
> I tested many times to find it is the CSS file that made the strange rim.The
> CSS files apply to  all the  pages  using  display-tag.I  do  NOT   know
> how to limit the scope  of the CSS files' application areas.
> I am trying  eXtremeComponents following *David G. Friedman's *advice*.
> *And,David G. Friedman,I've got another question for you:
> How can you limit the scope of the CSS files ?Any table(including the table
> which is not the display-tag table) will be applied to the same  CSS if I
> use display-tag's CSS file as following:
> ......
> > </head>
> >  <link rel="stylesheet" type="text/css" href="css/maven-base.css">
> >  <link rel="stylesheet" type="text/css" href="css/maven-theme.css">
> >  <link rel="stylesheet" type="text/css" href="css/site.css">
> > <link rel="stylesheet" type="text/css" href="css/screen.css">
> > <body>
> > **.......
> Thanks a lot.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message