coding help
Icon Magnifying Lens LR24
This page contains external links.
Be mindful of where you click. We do our best to link to reliable, safe websites. Still, you're responsible for your own internet safety.

Introduction

Cascading Style Sheets (commonly abbreviated as CSS) is a style sheet coding language used to predefine and modify a coded document written in a markup language like HTML. This article will focus on CSS3, the most recent and commonly used type of CSS.

Development

CSS was first proposed in 1994, and again in 1995, when the World Wide Web Consortium (W3C) took an interest in CSS and began to adopt it. Later, a company called CERN updated and changed HTML and CSS so that CSS could be put into HTML documents.

Since then, CSS has become more and more common and has updated from CSS1 to CSS2, and so on until the latest version, CSS3.

Usage

How CSS Executes

Like HTML, CSS is a web-based coding language, meaning web browsers receive CSS documents from close servers and translate CSS into a display. If parts of the page are not specified, browser defaults will take over, such as how on FANDOM, we automatically have left align and black text. However, some attributes of CSS does not run on FANDOM unless in certain cases.

Parts of CSS

CSS is made up mainly of attributes, however, CSS attributes aren't formatted the same as HTML attributes. Let's explore what attributes are and how they are formatted.

Attributes make up many visual codes and can re-define some visual aspect of a coded item.

In CSS, attributes are formatted as following:

item name {
    ATTRIBUTE: SPECIFICATION;
    ATTRIBUTE: SPECIFICATION;
    ATTRIBUTE: SPECIFICATION;
}

And so on, with semicolons (;) separating attributes and {}'s defining where the attribute specification starts. Below, we can see an example of this:

.test {
    color: orange;
    border: 2px dotted lime;
    background: green;
}


Now, if we want to, we can transfer this bit of CSS code into Wikitext code (this is also called inline CSS), these can be inserted directly onto wiki pages:

TEXT


The code for this looks as following:

<div style="color: orange; border: 2px dotted lime; background: green">TEXT</div>

See how it is almost the same as the CSS code, just without a name and compressed into one line? We can do this with most CSS code! If we just take away the indents and the .test { } part of it and replace that with <span style=""> or <div style="">, we get Wikitext, or HTML!

Recommended Sites

See also: