Ask Your Question
2

Feature request: Add classes to body in default skin

asked 2010-05-01 01:42:08 -0500

Pekka gravatar image Pekka
550 22 28 37

updated 2011-06-12 23:50:26 -0500

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
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 */
delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2010-05-06 13:29:51 -0500

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

updated 2011-06-13 11:58:31 -0500

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 publish delete flag offensive edit

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 ( 2010-05-06 15:28:27 -0500 )edit
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 ( 2010-05-06 15:29:05 -0500 )edit
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 ( 2010-05-06 15:30:17 -0500 )edit
Allright, let's do it if it helps and yes please do commit you r customization it it's ok with you. Evgeny ( 2010-05-06 19:22:02 -0500 )edit

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]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2010-05-01 01:42:08 -0500

Seen: 812 times

Last updated: Jun 13 '11