Embarking on the journey to create a website from scratch? Understanding the fundamentals of HTML and CSS is your first crucial step. These two languages are the building blocks of any website, and mastering them will set you on the path to becoming a proficient web developer.

In this guide, we'll delve into the basics of HTML and CSS, providing you with a solid foundation and a template to kickstart your web development journey.

HTML: The Structure of Your Website
HTML, or HyperText Markup Language, is the standard markup language for creating web pages. It provides the structure and content of your website, while CSS handles the presentation.

Let's start with a basic HTML template:
```html
Welcome to My Website

About Me
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
My Skills

- HTML
- CSS
- JavaScript
```
HTML Tags and Elements

In the template above, you'll notice various HTML tags. These tags define the structure of the webpage. For instance, `
` to `` tags are used for headings, `
` for paragraphs, `
- ` and `
- ` for list items.
- ` for unordered and ordered lists, respectively, and `
Each HTML element is enclosed within opening and closing tags. The opening tag defines the element, and the closing tag ends it. The content of the element goes between these tags.




















HTML Attributes
HTML attributes provide additional information about HTML elements. In the template, the `` tag has attributes like `charset` and `viewport`, and the `` tag has an `href` attribute that points to the CSS file.
The `
CSS: Styling Your Website
CSS, or Cascading Style Sheets, is responsible for the presentation of your website. It controls the layout, colors, fonts, and other visual elements.
Let's create a simple CSS file (styles.css) to style the HTML template:
```css body { font-family: Arial, sans-serif; margin: 0; padding: 0; line-height: 1.6; } header, footer { background-color: #f8f9fa; padding: 20px; text-align: center; } h1, h2 { color: #333; } ul { list-style-type: none; padding: 0; } li { margin-bottom: 10px; } footer p { color: #777; } ```
CSS Selectors
In the CSS file, you'll see various selectors. Selectors are used to target HTML elements. Element type selectors, like `body`, `header`, and `footer`, target all elements of that type. Class selectors, like `.container`, target elements with a specific class. ID selectors, like `#unique-id`, target elements with a unique ID.
You can also combine selectors to target specific elements. For instance, `h1, h2` targets both `
` and `` elements.
CSS Properties and Values
CSS properties define the styles of HTML elements. In the template, `font-family`, `margin`, `padding`, `line-height`, `background-color`, and `color` are some of the properties used. The values following these properties determine the style's appearance. For instance, `Arial, sans-serif` is the font family, `0` is the margin and padding, `1.6` is the line height, and `#f8f9fa` and `#333` are the hex color codes.
You can also use shorthand properties, like `margin` and `padding`, to set all four sides at once.
With this foundation, you're ready to start building and styling your own websites. Happy coding!