Add ReplyNew Thread

 Styling Specific Pages [Jcink]
 Posted: March 7th, 2014, 10:48 AM
Advanced Member
Posts:38Group:MemberJoined:March 5th, 2014
Send Message

This is a pretty simple modification that allows you to style specific pages - sorry if it's redundant of anything already here. All you have to do to allow it is find and replace <body> with:

<body class="<!-- |input_act| -->">

Using view-source, you can see what class it throws, and use it to style a specific page or section of your site. For instance, if you wanted you cbox to only show up on the index, you could use the following CSS:

#cboxdiv {display: none}
.idx #cboxdiv {display: block}

I don't believe that this works outside of Jcink; correct me if I'm wrong.

And incomplete list of pages:
(I'll add to it as I encounter it on the skin I'm working on.)
.idx Index, Category View
.SF Subforum View
.ST Topic View,
.Post Post a new Topic, Reply, Create a New Poll
.Profile Profile View

This post has been edited by Owl: March 7th, 2014, 12:32 PM
 Posted: April 2nd, 2014, 01:30 PM
Finally finished.
Posts:290Group:AdministratorJoined:July 14th, 2013
Send Message

Very much late to the party, but this is a technique I employ all the time and I absolutely love it. Thanks for getting this up, Owl, more people need to know about this one.

I'd argue against using classes for this, though. It makes more sense from the standpoint of an observer to use ids instead.

Ids are meant to identify unique resources, the kind that can only appear on a page once, which is exactly what you're doing here since there can only be one <body> tag on the page. (I'd have used Ids over on this too, if I could have gotten away with it. Too bad an element can only have one id!) Id selectors are rendered faster than class selectors- though with modern computers, this is honestly not that big a difference. Finally though, they're also easier to access via JavaScript should someone want to make use of them. Two birds with one stone!

Topic Options Add ReplyNew Thread



Latest Shouts In The Shoutbox -- View The Shoutbox · Rules   

's reputation