Ask Your Question
1

Feature request: Add classes to body in default skin

asked May 01 '10

Pekka gravatar image Pekka
500 19 26 34

updated Jun 12 '11

Evgeny gravatar image Evgeny flag of Chile
6665 31 49 95
http://askbot.org/

If the <body> tag of each page had a class that corresponds with its URI:

<body class="questions">
<body class="tags">
<body class="people">
<body class="badges">
<body class="ask">

it would become very easy to apply specific CSS styles to specific pages:

body.tags div.AList { ..... }  /* Rule applies to tags page only */

1 Answer

Sort by ยป oldest newest most voted
1
Pekka has selected this answer as correct

answered May 06 '10

Evgeny gravatar image Evgeny flag of Chile
6665 31 49 95
http://askbot.org/

updated Jun 13 '11

Done a while ago, a page name is added to the class at most pages (but not all yet - only those that required that for the styling).

For example, main page has class "main-page", also multiple classes are used everywhere, at the expense of not supporting IE6, which is almost extinct by now.

Also, added a document on skin customization: http://askbot.org/doc/customizing-skin-in-askbot.html

link

Comments

Thanks Evgeny. The great thing about adding classes to the body is that you can target common elements *on a specific page*. I.e. you can say "I want the Ask A Question button to be big and red on the front page, but not on the other pages". At the moment, you would have to touch the HTML for that. Pekka (May 06 '10)
As for marking up and freezing important elements, that is certainly a great idea. I'm all for it, if I can be of any assistance let me know. Pekka (May 06 '10)
When my custom skin is ready to look at, I'll be happy to push it to the Git repo into a new directory if that's ok. Pekka (May 06 '10)
Allright, let's do it if it helps and yes please do commit you r customization it it's ok with you. Evgeny (May 06 '10)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: May 01 '10

Seen: 783 times

Last updated: Jun 13 '11