Monday 2 October 2023

Basic Properties of CSS

 Basic Properties of CSS

A CSS property is something we use to style or decorate the HTML content we write. There are many CSS properties. Some of them are listed below.

  • Color Properties
  • Size Properties
  • Border Properties
  • Text Properties

CSS properties are commonly used here are many CSS properties to style the following HTML elements. Below are some examples.



Text Properties of CSS

  • Font Family
  • Font Size
  • Font Weight


Font-family

Allow us to change the font type used.

Any standard font can be used.


Font-size

May be specified using a few different types.

The easiest to work with is pixels (px).


Font-weight

May be specified using a few different types.

The easiest to work with is pixels (px).

Code:-


Output:-

Color Properties of CSS

  • Color
  • Background color


Color

Allows us to specify the color of the text.


Background-color

Allows us to specify the background color for the element.

Code:-

Output:-


Spacing Properties of CSS

  • Padding
  • Margin
  • Border

Padding

Refers to the space around our content.


Margin

Similar to padding in that it affects the spacing around the content.


Border

Is in between the padding and margin.

Spacing Properties will be discussed in detail in upcoming lessons.



Written by:  W.A. Eranga Dewmini

No comments:

Post a Comment

Java Script Learning

 Introduction to JavaScript JavaScript is the programming language used by front-end web developers to instruct the browser to add behaviors...