Re: [css-d] CSS wildcards

2006-01-25 Thread Stephen R Laniel
On Wed, Jan 25, 2006 at 10:52:01AM -0500, Jim Ryan wrote:
> can I use the wildcard
> .dynamic_rightnav-* li{border:1px dotted red;}

This comes up often:
http://www.hixie.ch/specs/css/wwwstyle/#selectors

Sadly, the answer is no.

I suppose you could build a layer atop CSS -- say, a program
that parses a "CSS+Regexen" sheet, looks at the HTML to
which it's being applied, finds the elements in the HTML
that match the regex, and generates a stylesheet containing
those elements. But it's not part of CSS.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
Cell: +(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] CSS wildcards

2006-01-25 Thread Stephen R Laniel
On Wed, Jan 25, 2006 at 11:19:42AM -0500, Zoe M. Gillenwater wrote:
> CSS is not a programming language, so it doesn't have variables in it.  
> You define set classes and ids that appear in your source somewhere.

Just to be clear, it's a totally reasonable thing to expect
from CSS. It would be nice to be able to define

h[0-9] {
font-family: Verdana, sans-serif;
}

instead of the ungainly

h1, h2, h3, h4, h5, h6, h7, h8, h9 {
font-family: Verdana, sans-serif;
}

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
Cell: +(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] space between paragraphs

2005-06-27 Thread Stephen R Laniel
On Mon, Jun 27, 2005 at 05:46:17PM -0600, Eliana Berlfein wrote:
> The space between paragraphs is much bigger on a PC than a Mac. Is 
> there some way to  control the space and make it more consistent?

You could do

p {
margin-bottom: [some length];
padding-bottom: [some other length];
margin-top: [still another length];
padding-top: [a fourth length];
}

Let us know if that works for you.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] space between paragraphs

2005-06-27 Thread Stephen R Laniel
On Mon, Jun 27, 2005 at 08:41:03PM -0400, Felix Miata wrote:
> > The space between paragraphs is much bigger on a PC than a Mac. Is
> > there some way to  control the space and make it more consistent?
> This is something set by the user agent. In Firefox the rule is thus:
> 
> p {margin: 1em 0;} (res/html.css)

Wait, doesn't the page's author's CSS override the browser's CSS?

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] space between paragraphs

2005-06-27 Thread Stephen R Laniel
On Mon, Jun 27, 2005 at 10:04:04PM -0400, Felix Miata wrote:
> > Wait, doesn't the page's author's CSS override the browser's CSS?
> Only when the author actually does it. He doesn't have to.

But if the original poster was trying to figure out how to make
her pages look good in multiple browsers, the correct answer is to
change the page's CSS.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


[css-d] Footnotes

2005-07-08 Thread Stephen R Laniel
I'd like to create CSS2 footnotes that

a) are easy for web developers to code,
b) are auto-numbered, and
c) only display a number surrounded by brackets most of the
   time, and
d) only display the footnote when you hover over the number.

By a), I mean that a developer would only have to do

This is the text that will appear when hovering.

and it would behave as expected. The first .footnote on the
page would show only "[1]" until you hoveered, the second
would display "[2]", and so on.

Has this already been done?

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Footnotes

2005-07-09 Thread Stephen R Laniel
On Sat, Jul 09, 2005 at 02:04:21PM +0900, Philippe Wittenbergh wrote:
> Deerpark alpha (developers preview for Firefox 1.1) does support 
> counters as well.

Ah so. I wondered why my Firefox (1.0.4) wasn't properly
handling counters. That would be the explanation.

Is there a canonical place to look to see which browsers
support which CSS properties?

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] The same text on several sites?

2005-07-09 Thread Stephen R Laniel
On Sat, Jul 09, 2005 at 09:28:04PM +0100, Markus Winter wrote:
> and I already have the next question - I have a bit of text which has to be
> on several websites (but can't be in a frame). Is there a way to incorporate
> this into several websites while having to edit it only once (otherwise when
> changes have to be made I would need to change at least 10 websites)?

I suspect the best way to make this happen would be either

1) Server-Side Includes
or
2) a bit of Javascript included in each file.

The latter is, in my view, a hack that makes poor use of
Javascript, but clients of mine have used it and I've
grudingly admitted that it's probably the best they could do
under the circumstances. These clients used webhosts
that refused to let them use much server-side architecture
at all, so they've had to push all their templating out to
the client.

So the Javascript approach includes a standard file -- call
it /boilerplate.js -- that looks like so:

function boilerText() {
document.writeln("This is the text that will appear everywhere.");
}

Then call boilerText() at some point.

The annoyance here is that you'll need to include
/boilerplate.js in every file you send out. The advantage is
that once you've included boilerplate.js, you can ignore the
files that include it and just edit boilerplate.js to make
changes across your site.

I'd prefer the SSI route, if it's available to you. SSI +
mod_rewrite is super-handy. In the .htaccess file for your
website, include something like this:

RewriteEngine On
RewriteRule ^(.*\.html) template.shtml?$1

Then let template.shtml look something like this:





Now every page will have a standard header and footer, with
the part between the header and footer depending on what the
user asked for: every request for

http://example.com/foo.html

will turn -- via mod_rewrite -- into a request for

http://example.com/template.shtml?foo.html

But users will never see that.

Sorry if I rambled on too long. Basically what you're
looking for is a template, and I think these are the
simplest approaches to getting server- or client-side
templating.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] CSS condenser tool

2005-07-15 Thread Stephen R Laniel
Perhaps relatedly: one of my clients, for reasons unknown to
me, uses a very efficient brand of CSS, wherein they have a
separate CSS file for every browser. This in itself
wouldn't be inefficient, but every file reproduces a great
deal of content from the others. Obviously the more
efficient route would be to create a global stylesheet with
properties common to all browsers, then use browser-specific
stylesheets that include the global one.

So what I'd like to find is a tool that reduces all those
stylesheets to a canonical form, then compares them,
extracts the common elements, and pushes those off to a
global sheet.

Has something like this been written? Has at least the
canonicalization part been written? If I could canonicalize,
I could write a script to take it from there. I started
writing my own parser for the CSS grammar, but I assume this
wheel has already been invented.

The online CSS optimizer that you linked to doesn't explain
what it does -- it says to click on the About page, but
there is no such page. Does the online optimizer handle the
canonicalization that I'm looking for?

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] CSS condenser tool

2005-07-15 Thread Stephen R Laniel
On Fri, Jul 15, 2005 at 11:31:57AM -0400, Stephen R Laniel wrote:
> Perhaps relatedly: one of my clients, for reasons unknown to
> me, uses a very efficient brand of CSS, wherein they have a

That should be 'very inefficient'.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Alternating row colors in table

2005-09-05 Thread Stephen R Laniel
On Mon, Sep 05, 2005 at 10:41:34AM -0600, JJ wrote:
> I'm trying to setup styles for a simple table that will allow me to 
> easily alternate row colors.  For simplicity in programming the page 
> generation, I'd ideally like to apply the style to the  tags rather 
> than the  tags, but I'm not sure how to designate that in the css.  
> Is this possible?

I suspect what you'll want to do is set up an 'oddrows'
class and an 'evenrows' class, a la

.oddrows {
background-color: blue;
}

.evenrows {
background-color: white;
}

then give the table a unique ID, a la


...


then write a little Javascript to

1) find the unique element with the ID "alternatingrows".
2) iterate over the rows in that element, alternately
   labeling them 'even' or 'odd'.

Alistapart.com tackled this a while ago with Zebra Tables:
http://www.alistapart.com/articles/zebratables/

See if that does what you want.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Designing without tables

2005-09-21 Thread Stephen R Laniel
On Wed, Sep 21, 2005 at 03:54:21PM -0600, Tim Zappe wrote:
> My experience with Sitepoint is that I bought and read DHTML Utopia. I don't
> recomend that book because it did not focus on XHTML, but rather HTML
> 4.0which is something I'd rather not write in.

Um ... the two are virtually identical. XHTML can be
described as "HTML 4.0 plus XML cleanliness." So whereas in
HTML 4.0 you could do



, in XHTML you're only allowed to do



Not a huge difference.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key


signature.asc
Description: Digital signature
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/