views:

2665

answers:

3

I installed mediawiki on my server as my personal knowledge base. Sometimes I copy some stuff from Web and paste to my wiki - such as tips & tricks from somebody's blog. How do I make the copied content appear in a box with border?

For example, the box at the end of this blog post looks pretty nice:
http://blog.dreamhost.com/2008/03/21/good-reminiscing-friday/

I could use the pre tag, but paragraphs in a pre tag won't wrap automatically.. Any ideas?

+2  A: 

Mediawiki supports the div tag. Combine the div tag with some styles:

<div style="background-color: cyan; border-style: dashed;">
A bunch of text that will wrap.
</div>

You can play around with whatever css attributes you want, but that should get you started.

Steve K
+6  A: 

Actually, this is a better way to do it:

<blockquote style="background-color: lightgrey; border: solid thin grey;">
Det er jeg som kjenner hemmeligheten din. Ikke et pip, gutten min.
</blockquote>

The blockquotes are better than divs because they "explain" that the text is actually a blockqoute, and not "just-some-text". Also a blockquote will most likely be properly indented, and actually look like a blockqoute.

Oddmund
Can you explain why blockquote is better than div? Thanks!
SamS
+6  A: 

I made a template in my wiki called Template:quote, which contains the following content:

<div style="background-color: #ddf5eb; border-style: dotted;">
{{{1}}}
</div>

Then I can use the template in a page, e.g.,

{{quote|a little test}}

Works pretty well - Thanks!

SamS
upvoted because creating a template is the way to go, even if you use divs or a different style than the one in this answer.
davenpcj