
Because the last tip was only really useful to Classic wiki users, I’ve pushed up the next tip on CSS styles to this week. Enjoy!
A lot of gibberish gets thrown around by some of the advanced PBwiki users, particularly those with experience in web design, including HTML (HyperText Markup Language), the code that makes up every webpage on the Internet and CSS (Cascading Style Sheets), the current standard for formatting and styling HTML. Today, we’re going to focus on CSS as a way to format parts of your wiki the way you want, using specific examples. Although I plan on explaining CSS more thoroughly in a future post, I won’t go into the details for now, focusing on getting you real results.
The following is a semi-dorky moment, which will be useful if you actually want to learn CSS. If you just need a quick fix, like hiding your SideBar or something, please skip ahead
CSS can be inserted into PBwiki a number of different ways:
<style>
#displaycontent {
background:green;
}
</style>
which would turn the content area into an atrocious green color. A few notes:
<p style="border:1px solid black; padding:3px">a bunch of stuff inside the paragraph</p>
The final thing would look like this:
a bunch of stuff inside the paragraph
Now you know where to put your CSS, it’s time for what to put there.
Rather than try to go with an abstract approach, I’m going to give you ways to modify two very useful PBwiki elements: the SideBar and paragraphs.
Before we begin, Point-and-Click editor users should note that you will not see these style additions in the editor, but they will be loaded on a fully-rendered page.
Styles for the SideBar are oft-requested, and it’s actually pretty simple. The only problem with that is that some people have the original SideBar and others have the “new” 3-tabbed SideBar, but even that isn’t a real big issue. A few applications:
<style>#SideBar, #displaycontent div.sidebar_v2 { display:none; }</style>
As you can probably guess, that says, “For any SideBar element(#SideBar = old and #displaycontent div.sidebar_v2 = new), don’t display it.”
<style>#SideBar, #displaycontent div.sidebar_v2 { float:left; }</style>
<style>
#SideBar, #displaycontent div.sidebar_v2 {
background:#ccffcc;
color:#336633;
border:1px solid #66cc66;
}
</style>
This would make the SideBar a nice springtime green whether it was old or new. If you want to make sure link colors and all that other stuff matches, we’ll have to tackle that more complex issue in a future tip (or ask me in the forums).
A lot of writers use their wikis, and they’d like to be able to do things like indent or give paragraphs special colors. Let’s jump in:
<style>
#displaycontent p {
text-indent:30px;
}
#SideBar p, #displaycontent div.sidebar_v2 p {
text-indent:0px;
}
</style>
The first bracketed declaration says to indent all paragraphs within the user content area, while the second declaration nullifies that for any paragraphs that are inside the SideBar. You can see that example working here.
<p style=”text-indent:30px”>My paragraph…</p>
!Message for my valentine
<p class="special">I love u so much. Won't you love me too? ''--Your secret admirer''</p>
<raw escaped=0><style>
#displaycontent .special {
background:#ffeeee; /* a rosy background color */
color:red; /* a red font */
border:1px dashed red; /*a colored border */
padding:5px; /* space between border and text */
margin-right:250px; /* avoid hitting sidebar */
}
</style></raw>
The result is at the bottom of the same test page. You can see how each element effects the final product. Also, the text between /* and */ are comments that you can place anywhere inside the style tags, which I’ve used here to explain the properties being declared. Experiment and you’ll get the hang of it.
<style>
p.first:first-letter {
margin-top:5px;
margin-right:2px;
float:left;
font-size:400%;
font-family:Georgia,Verdana,serif;
border:1px solid #006000;
padding:5px;
color:#006000;
}
</style>
Then you would simply create a paragraph set to that class:
<p class="first">This is my paragraph...</p>
The final result will look like this. I don’t have space to go into the details here, but you’ll be able to find plenty of resources online if you’re interested.
Here’s a list of a few resources that I use in my own CSS design work.
W3 School’s CSS Tutorial
CSS Tutorial at YourHTMLSource.com
Well, that was a pretty heft workout, and we only scratched the tip of the CSS iceberg. Next week, we’ll take a break from all this CSS talk and I’ll go over a few general tips on making sure your wiki looks good to all your readers.
After that, we may come back to a few more CSS tips, depending on your comments. If there’s some particular thing you need style tips on, just email me at dochuyen84@gmail.com and I’ll either help you directly or it’ll show up in a future tip. See everyone soon!
One Response for "Tip of the Week #5: Simple Styles for Everyone!"
Wow! Awesome! I’m just a teacher learning to use wikis, and know only a little bit of HTML, but I find your explanations SO clear, I feel tempted to try them immediately… Thanks!!!!
Leave a reply