Web Tutorials
Web Tutorials
com
IWEB 141 TUTORIALS
What is HTML?
HTML (HyperText Markup Language) is the standard markup language used to create
web pages. It structures the content on the page and is often combined with CSS
(Cascading Style Sheets) and JavaScript for styling and functionality.
Explanation:
5. Practice
To practice your HTML skills:
1. What is CSS?
CSS is a stylesheet language used to describe the presentation of an HTML document. It defines
how elements should be displayed on the screen, in print, or in other media.
a. Inline CSS
html
b. Internal CSS
Place styles within a <style> tag in the <head> section of your HTML document.
html
<head>
<style>
body {
background-color: lightgray;
h2 {
color: green;
</style>
</head>
c. External CSS
Link to a separate CSS file using the <link> tag in the <head> section.
html
<head>
3. CSS Syntax
css
selector {
property: value;
Property: The style attribute you want to change (like color, font-size, etc.).
4. Common Selectors
css
p{
Class Selector: Selects elements with a specific class (use a dot .).
css
.my-class {
css
#my-id {
}
5. Basic Styling Properties
css
body {
h1 {
Font Properties
css
p{
Text Alignment
css
h2 {
css
div {
HTML (index.html):
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="content">
</div>
</body>
</html>
CSS (styles.css):
css
body {
background-color: #e0e0e0; /* Light gray background */
h1 {
.subtitle {
#content {
7. Practice
Create an HTML file and a CSS file using the examples provided above.
Modify the styles in your CSS file to see how they affect the HTML elements.
Experiment with different properties and values to understand how CSS works.
Online Tutorials: Websites like W3Schools and MDN Web Docs offer great resources.
Interactive Learning: Platforms like Codecademy or FreeCodeCamp provide interactive
CSS courses.
Feel free to ask if you have specific topics or questions about CSS that you’d like to explore!