User:Mathmagician/sandbox1

Thread:28809

Basic wiki markup for a table
Here's the code for our table: And here's the table:

Cascading Style Sheets
Cascading Style Sheets (CSS) is a language used for stylizing content. There are two basic ways to include CSS on a page, the first one is called inline CSS. With inline CSS, you place  pairs inside the   attribute (read more about CSS syntax). Here's some examples below.

width: 330px;
 * Using the width property to make the table 330 pixels wide:

background-color: #FFD700; /* gold, from the help page */
 * Using the background-color property to change the color of the background. Note: You can find a lot of different colors on the help page at >> Help:Color <<. You can also learn more about how they work by doing a google search for "hex color codes".

color: #000000; /* black, from the help page */
 * Using the color property to change the text color.

float: right;
 * Using the float property to make the table float to the right side of the screen:

text-align: center;
 * Centering text inside the table by using the text-align property:

border: 2px dashed #000000;
 * Setting how the border (outside edge) of the table looks by using the border property and using the same black color from before:

border-radius: 12px;
 * Making the corners rounded by using the border-radius property:

Inline CSS, using the style attribute
To apply these CSS rules to our table with inline CSS, we need to put them into the style attribute like this: style="width: 330px; background-color: #FFD700; color: #000000; float: right; text-align: center; border: 2px dashed #000000; border-radius: 12px;"

Applying this style to our table
We simply place the style at the top of the table in the code:  And here's the table: 

How do you know what CSS rules to use?
That's something that you learn from practice (and in school, if you're studying web design), and asking others when you get stuck. There is a CSS tutorial at w3schools that can help you get started. On the left side of that page, there are plenty of great links that explain how to do different things in CSS. It's definitely a hands-on thing, the best way to learn is to start using CSS and use any helpful resources (people, websites, etc.) that you can when you need help.

The CSS Box Model is definitely something you should read about, and then practice using it with the margin, border and padding properties.

Stylesheets
CSS can also be written in stylesheets, which are the second way of applying CSS that I mentioned above. While inline CSS with the style attribute appears as part of the HTML on the page, stylesheets are different in that the code goes on a separate page.

On Wikia, this is often the MediaWiki:Wikia.css page. Since stylesheets have to be included from there, on Wikia, only admins have the ability to edit stylesheets. However, anyone can use inline CSS.

Basic example of using CSS in a stylesheet
First, we need some HTML to apply styling to:

Next, we would write some CSS for the stylesheet. Use properties that you know, if you don't know which property to use, look it up online :)

And when that CSS is placed in your stylesheet (MediaWiki:Wikia.css) it would make: This is text inside a simple HTML DIV container