Lists and Types of Lists
Lists and Types of Lists
Ordered List:
HTML
<!DOCTYPE html>
<html>
<body>
<h2>Steps to Make Coffee</h2>
<ol>
<li>Boil water</li>
<li>Add coffee grounds to filter</li>
<li>Pour hot water over grounds</li>
<li>Enjoy your coffee!</li>
</ol>
</body>
</html>
2. CSS and types of CSS
This section explores Cascading Style Sheets (CSS), a
language that controls the presentation of a web page.
The notes might cover different types of CSS like inline
styles, embedded styles, and linked stylesheets. It
could also explain basic CSS properties like font size,
color, background, and margins.
Inline Styles:
HTML
<!DOCTYPE html>
<html>
<body>
<h1 style="color: blue; font-size: 2em;">This is a
heading</h1>
</body>
</html>
Embedded Styles:
HTML
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: red;
font-size: 3em;
}
</style>
</head>
<body>
<h1>This is another heading</h1>
</body>
</html>
External Stylesheet:
Create a separate CSS file (e.g., style.css) with styles:
CSS
h1 {
color: green;
font-size: 1.5em;
}
Then link it in your HTML:
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
</body>
</html>
3. Event models (without code, as it deals with
Javascript behavior)
Here are some examples of event models commonly
used in web development:
<script>
const button
=document.getElementById("myButton");
button.addEventListener("click", function() {
alert("You clicked the button!");
});
</script>
Here's an example:
HTML
<script>
input.addEventListener("keydown", function(event) {
}
});
</script>
Here's an example:
HTML
<div id="myBox"></div>
<script>
box.style.backgroundColor = "lightblue";
});
box.addEventListener("mouseout", function() {
});
</script>
Example (Simplified):