Learn HTML
Lesson 1 - Overview Of The Web And HTML
Lesson 2 - HTML Tags And Elements
Lesson 3 - Images And Multimedia
Lesson 4 - Writing Your First HTML Page
Lesson 5 - Overview Of CSS
Lesson 7 - Applying CSS To HTML
Lesson 8 - Box Model
Lesson 9 - Positioning And Layout
Lesson 10 - Flexbox
CSS properties define the styles you want to apply to the selected elements. Here are some common CSS properties:
<style> p { color: blue; } </style> <p>This is a text.</p>
This will make the text in all <p>
elements blue.
<style> p { font-size: 20px; } </style> <p>This is a text.</p>
This will make the text in all <p>
elements 20 pixels high.
<style> p { background-color: lightgrey; } </style> <p>This is a text.</p>
This will make the background color of the paragraph element.
<style> h1 { margin: 20px; } </style> <h1>Some text here</h1>
This will add 20 pixels of space around all <h1>
elements.
<style> div { padding: 15px; background-color: lightgrey; } </style> <div>Some text here</div>
This will add 15 pixels of space inside all <div>
elements, between the content and the border.
<style> p { border: 1px solid black; } </style> <p>This is a text.</p>
This will add a 1-pixel solid black border around all <p>
elements.
<style> div { width: 200px; height: 100px; background-color: lightgrey; } </style> <div><div>
This will set the width of all <div>
elements to 200 pixels and the height to 100 pixels.