CSS

Share

What is CSS?

CSS (an abbreviation for Cascading StyleSheets) is a programming language used mainly for declaring styles in webpages. With CSS, it's possible to define the color and size of text, the background color, the style of borders, and even the position of elements on a webpage, among dozens of other things.

Example of CSS Code

/* This gives elements that match this selector
   a padding and a border. */
.panel {
    padding: 5px;
    border: 1px solid #000;
}

.title {
    font-size: 200%;
}

/* This selector overrides the font-size property
   for titles that are descendants of panels. */
.panel .title {
    font-size: 150%;
}

/* This makes elements marked with both
   "panel" and "warning" classes to
   have a yellow background. */
.panel.warning {
    background: #ff0;
}

Comments

Leave a Reply

Leave your thoughts! Required fields are marked *