MORE CSS PROPERTIES : Let’s have a look at some of the CSS properties we can add to our HTML elements to make our web pages more exciting.

As you know already, CSS is always made up of a property and a value. There are hundreds of different CSS properties and values, but here are some of the most common:

CSS property name What does it do? Example values
background-color Sets the colour of your background red; black; white; yellow;
color Sets the colour of your text red; black; white; yellow;
text-align Positions your text around
the page
left; right; center;
font-size Changes the size of your text 12px; 20pt;
float Positions your element to the left
or the right of another element
left; right; none;
height Sets the height of your element 100px; 100%;
width Sets the width of your element 100px; 100%;
border Gives your element a border 1px solid black;
margin Adds space around your element 10px;
padding Adds space inside your element 10px;

Graphics on your computer screen are made up of tiny coloured dots called PIXELS (px). You can tell your browser how many pixels you want to be in a HTML element.

Related Posts:

Alignment CSS properties

CSS, HTML, JAVASCRIPT, Online Compiler. Code on the go by

Building a web page with HTML tags

Build to-do list web-app with code


Why do most sites use cookies?

Tips and Tricks for WRITING JAVASCRIPT code

CODING WITH CSS: The style attribute