February 23, 2017, 03:05:04 PM

Using CSS in Posts

CSS (or "Cascading Style Sheets") is a language that specifies how to display a webpage. It was introduced with HTML 4.0 to provide a way to efficiently keep styles throughout a whole website. If you have no idea what CSS is, I suggest you learn how to use it here--otherwise this page is completely useless to you.

The "BBCode with Style" package allows you to use classes and inline CSS in your posts when specified as an attribute in table, tr, td, img, hr, list, and li. If you want to style something that isn't in one of these tags, the package also provides span and div tags. Now let us see an illustration (or illustrations, I guess):

Code: [Select]

[table class="table_grid"]
[td class="windowbg"]Hello,[/td]
[td class="windowbg2"]world![/td]

Here is some [span style="color:red; font-weight:bold;"]text[/span].
Here is some [div style="color:red; font-weight:bold;"]other[/div] text.


Here is some text.
Here is some

Div tags are meant to be used for blocks of content, which is why "other" is written on a new line. Span is meant to be used inline, so the whole sentence appears on one line.

Classes are preferred to use as they take up less text (and therefore take less time to load), but they're also a thing that you have no ability to change. It also might be a problem if you don't know which classes exist--which can easily be solved by viewing our CSS file right here.