HTML_CSS_Guide
HTML_CSS_Guide
--------------------------------
HTML provides the structure and content of a web page. It uses tags and attributes to define elements.
1. Basic Structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
2. Common Tags:
- Lists:
- Ordered: <ol><li>Item</li></ol>
- Unordered: <ul><li>Item</li></ul>
- Tables: <table> with <tr>, <td>, and <th> for rows and cells.
3. Attributes:
4. Semantic HTML:
- Text Elements: <strong> (important text), <em> (emphasized text), <blockquote> (quoted text).
----------------------------
CSS is used to style and layout web pages, controlling aspects like colors, fonts, and positioning.
1. Types of CSS:
selector {
property: value;
Example:
h1 {
color: blue;
font-size: 24px;
3. Selectors:
4. Box Model:
5. Positioning:
6. Responsive Design:
- Media Queries:
body {
background-color: lightblue;
7. CSS Preprocessors:
Tools like Sass and LESS extend CSS with features like variables, nesting, and functions.
---------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Styled Page</title>
<style>
body {
background-color: #f0f0f0;
color: #333;
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background: white;
border-radius: 8px;
</style>
</head>
<body>
<div class="container">
<h1>Hello, World!</h1>
</div>
</body>
</html>