2_Computer science grade 10 CSS_presentation_ 2 variant

  • pptx
  • 09.05.2020
Публикация в СМИ для учителей

Публикация в СМИ для учителей

Бесплатное участие. Свидетельство СМИ сразу.
Мгновенные 10 документов в портфолио.

Иконка файла материала 2_Computer science grade 10 CSS_presentation_ 2 variant.pptx

Cascading Style Sheets (CSS)

10.4.2.1 use HTML in web-development;

Styling HTML with CSS

CSS stands for Cascading Style Sheets.

CSS describes how HTML elements are to be displayed on screen, paper, or in other media.

CSS can be added to HTML elements in 3 ways:

Inline - by using the style attribute in HTML elements
Internal - by using a

This is a heading

This is a paragraph.

External CSS

An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the section of the HTML page:

This is a heading

This is a paragraph.

This is a heading

This is a paragraph.

An external style sheet can be written in any text editor.
The file must not contain any HTML code, and must be saved with a .css extension.

body {     background-color: powderblue; } h1 {     color: blue; } p {     color: red; }

CSS Fonts

The CSS color property defines the text color to be used.
The CSS font-family property defines the font to be used.
The CSS font-size property defines the text size to be used.

CSS Border

The CSS border property defines a border around an HTML element:
p {     border: 1px solid powderblue; }

CSS Padding

The CSS padding property defines a padding (space) between the text and the border:
Example
p {     border: 1px solid powderblue;     padding: 30px; }

CSS Margin

The CSS margin property defines a margin (space) outside the border:
p {     border: 1px solid powderblue;     margin: 50px; }

CSS Syntax and Selectors

A CSS rule-set consists of a selector and a declaration block:

The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a CSS property name and a value, separated by a colon.

The id Attribute

To define a specific style for one special element, add an id attribute to the element:

I am different


then define a style for the element with the specific id:

Examples

#p01
{     color: blue; }

#para1 {     text-align: center;     color: red; }

The class Attribute

To define a style for a special type of elements, add a class attribute to the element:

I am different


then define a style for the elements with the specific class:

Examples

.center {     text-align: center;     color: red; }

p.center {     text-align: center;     color: red; }