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 nameWhat does it do?Example values
background-colorSets the colour of your backgroundred; black; white; yellow;
colorSets the colour of your textred; black; white; yellow;
text-alignPositions your text around
the page
left; right; center;
font-sizeChanges the size of your text12px; 20pt;
floatPositions your element to the left
or the right of another element
left; right; none;
heightSets the height of your element100px; 100%;
widthSets the width of your element100px; 100%;
borderGives your element a border1px solid black;
marginAdds space around your element10px;
paddingAdds space inside your element10px;

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 replit.it

Building a web page with HTML tags

Build to-do list web-app with code

CODING WEB PAGES (HTML, CSS, & JavaScript)

Why do most sites use cookies?

Tips and Tricks for WRITING JAVASCRIPT code

CODING WITH CSS: The style attribute