February 25, 2005

Question...

I had this thought about how to do something and I wanted to run it by everyone else to see if it sounded like it would work or if it would have any problems.

I'd like to work out something like "asides" (see here for explanation of how it works in WP) on MT. Basically, posts from a certain category would display completely different on the main page than posts from other categories (but would still appear in the order they are posted). My thought is to create a separate style sheet named after the category (asides.css) and have in my template have the style sheet called up depending on the category of the post. So, if the category was 'asides' it would call up the asides.css In that file, I would simply have the display:none turned on for certain parts of the posts (like the comments, etc.)

Here's my question though. I've never seen coding where a whole stylesheet was called up in the body of the code (only in the header). Is it possible? Secondly, if the style sheet didn't exist (which it won't for all the other categories), what's going to happen? Third, am I just making this needlessly complicated?

Oh, and another question - is it possible to do a random image scripty thing inside of a stylesheet? Or am I just dreaming on that one?

Posted by Daniel at February 25, 2005 02:05 PM
Comments
#1

Why not use "Div" tags? That way you can have your CSS define multiple styles based on which Div you assign to a particular post.

Posted by Ted at February 25, 2005 03:40 PM
#2

But it's not just the style. I want to change (or make non-visible) the actual content - the html - of an individual post.

Posted by Daniel at February 25, 2005 03:47 PM
#3

Asides would have been great for the robot posts i'm doing this week, where i've been using the [font face="terminal"] code to make them look different.

Posted by annika at February 25, 2005 05:26 PM
Live Comment Preview
Post a comment









Remember personal info?