Help:CSS at Wikiversity
No manual
edit- Currently there is no manual for CSS (style sheets) for the pages of Wikiversity. Therefore, I am trying to rough out a list of what is possible. Once this is done, it will need a complete rewrite to get it into a useable form for instructors.Robert Elliott
- More info on CSS can be found at http://www.w3schools.com/css/css_units.asp and http://www.w3schools.com/css/css_reference.asp
CSS at Wikiversity
CSS coding in simple HTML paragraphs
The paragrapheditA new paragraph is created with two carriage returns, not one. Break also creates a paragraph.
Other paragraph formatting can be done with the ":" and ";" symbols at the beginning of a line (even without two carriage returns.) Another option is to use HTML paragraphs with CSS coding. <p>This text does not have any style applied to it.</p> This text does not have any style applied to it.
<p style = "font-size: 20pt">This text has the font-size style applied to it, making it 20pt.</p> creates This text has the font-size style applied to it, making it 20pt. The only way to get multiple paragraphs is by using the break symbol <p style = "font-size: 20pt">This text has the font-size style applied to it, making it 20pt. <br><br> This looks like a single paragraph when I write it but separate in the final output. </p> This text has the font-size style applied to it, making it 20pt. Therefore, you have to be careful how you use this. |
CSS coding that I find useful
Simple paragraphsedit<p style = "font-size:16pt; background-color: Gold; margin-left: 1cm">Big colorful heads </p> Big colorful heads
|
Codes for paragraphs
Style Sheet formattingeditstyle="width:200px" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="width: 60%" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="background-color: Red" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="margin-left: 2cm" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="background-color: Red" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="font: 8pt/16pt georgia; margin-top: 100px; text-align: justify;" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="position:relative; left:100px; top:15px" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text.
style="font-style: italic" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="marging-left:4em" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text. style="text-indent:8em" This text which has been typed to look like two paragraphs. This paragraph has lots of text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text and text.
font-family - Sets the typeface. font-size - Sets the font size. font-weight - Sets the thickness the text will be, values like bold and normal. font-style - Sets the style of the text, common values are normal and italic. font-variant - Modifies the text, e.g. small-caps. line-height - Sets the spacing between the baselines of adjacent lines of text.
Coding <p style = "font-size: 14pt;font-family: georgia; text-align: center">Coding</p> |
Simple Table
editHere is a simple table created with pipes
{{center top}} {| border=1 cellspacing=0 cellpadding=5 | This | is |- | a | '''table''' |} {{center bottom}}
Which looks like this
This | is |
a | table |
The coding
editThese are not style sheet styles so I don't know what to call them:
- border=1
- cellspacing=0
- cellpadding=5
Making improvements
editWe can expand on this by adding color and a fixed width
{{center top}} {| border=1 cellspacing=0 cellpadding=5 style="width:200px; border: DarkGreen solid 1px" | bgcolor="#ccff99" | This | bgcolor="#ececec" | is |- | bgcolor="#99ccff" | a | bgcolor="red" | {{center top}}{{font|color=green|'''table'''}}{{center bottom}} |} {{center bottom}}
This | is |
a |
' table'
|
Adding width to the entire table
editThe basic rule is to add CSS items which affect the entire table in the first line. In this example, I added style="width:200px" to create the width for the entire table
{| border=1 cellspacing=0 cellpadding=5 style="width:200px"
Adding color individual boxes
editThe basic rule is to add CSS items which affect the entire table in the first line. In this example, I added bgcolor="#ccff99"" plus an extra pipe (vertical line) to create the color for the first box in the table
| bgcolor="#ccff99" | This
Codes for tables
|
Codes for items in tables
Basic formattingedit
Style Sheet formattingedit
|
DIV coding
I do not know what a DIV is but it works for some things Robert Elliott Basic formattingedit<div style="margin-left: auto; margin-right: auto; width:80%"> <div style="padding:1em 5em 1em 3em;"> <!--Top, right, bottom, left --> <div style="border-bottom:1px solid Gold; background-color:#ffffaa; padding:0.2em 0.5em 0.2em 0.5em; font-size:110%; font-weight:bold;">Title</div> |
This text has the font-size style applied to it, making it 20pt.