1. Web design
Introduction of html and css
Welcome to our introduction to CSS and HTML! In this chapter, we'll
explore the fundamentals of these core web development technologies,
including hands-on examples and step-by-step calculations. "CSS and
HTML are like peanut butter and jelly; they're simply better together." -
Chris Coyier, CSS-Tricks HTML (HyperText Markup Language) is the
backbone of any website, providing the structure and content for web
pages. CSS (Cascading Style Sheets), on the other hand, is responsible for
the visual presentation of that content. Let's start with a simple HTML
example: ```html
Welcome to My Web Page!
This is a paragraph of text.
``` In this example, we see the basic structure of an HTML document, including the doctype
declaration, html element, head element, and body element. The head element contains
metadata about the document, while the body element contains the actual content. In this
case, we have a heading (h1) and a paragraph (p) of text. Now, let's add some CSS to make our
web page look a bit nicer: ```css body { background-color: #f0f0f0; font-family: Arial, sans-
serif; } h1 { color: #333; text-align: center; } p { margin-left: 20px; margin-right: 20px; } ``` In this
CSS example, we've added some basic styles to our web page. We've set the background
color of the body element to a light gray (#f0f0f0), and the font family to Arial (or a sans-serif
font if Arial is not available). We've also styled the h1 element with a darker gray color (#333)
and centered alignment, and the p element with some margin to create some breathing room.
Now, let's dive into some of the more advanced features of CSS and HTML. One of the most
powerful features of CSS is its ability to select and style elements based on complex
conditions. For example, we can use the `:hover` pseudo-class to style an element when the
user hovers their mouse over it. Let's add a hover effect to our h1 element: ```css h1:hover {
Introduction of html and css
Welcome to our introduction to CSS and HTML! In this chapter, we'll
explore the fundamentals of these core web development technologies,
including hands-on examples and step-by-step calculations. "CSS and
HTML are like peanut butter and jelly; they're simply better together." -
Chris Coyier, CSS-Tricks HTML (HyperText Markup Language) is the
backbone of any website, providing the structure and content for web
pages. CSS (Cascading Style Sheets), on the other hand, is responsible for
the visual presentation of that content. Let's start with a simple HTML
example: ```html
Welcome to My Web Page!
This is a paragraph of text.
``` In this example, we see the basic structure of an HTML document, including the doctype
declaration, html element, head element, and body element. The head element contains
metadata about the document, while the body element contains the actual content. In this
case, we have a heading (h1) and a paragraph (p) of text. Now, let's add some CSS to make our
web page look a bit nicer: ```css body { background-color: #f0f0f0; font-family: Arial, sans-
serif; } h1 { color: #333; text-align: center; } p { margin-left: 20px; margin-right: 20px; } ``` In this
CSS example, we've added some basic styles to our web page. We've set the background
color of the body element to a light gray (#f0f0f0), and the font family to Arial (or a sans-serif
font if Arial is not available). We've also styled the h1 element with a darker gray color (#333)
and centered alignment, and the p element with some margin to create some breathing room.
Now, let's dive into some of the more advanced features of CSS and HTML. One of the most
powerful features of CSS is its ability to select and style elements based on complex
conditions. For example, we can use the `:hover` pseudo-class to style an element when the
user hovers their mouse over it. Let's add a hover effect to our h1 element: ```css h1:hover {