HTML Css Guide
HTML Css Guide
HTML (HyperText Markup Language) is the standard language for creating web pages. It describes
the structure of a web page using markup. CSS (Cascading Style Sheets) is used to style and layout
web pages. Together, HTML and CSS form the foundation of web development.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a paragraph.</p>
</body>
</html>
HTML elements are the building blocks of HTML pages. They are represented by tags. Attributes
provide additional information about elements. Common HTML elements include headings (<h1> to
<h6>), paragraphs (<p>), links (<a href='URL'>), images (<img src='URL'>), lists (<ul>, <ol>, <li>),
Forms are used to collect user input. The <form> element wraps input elements like text fields,
<form>
<label for='name'>Name:</label>
</form>
CSS is used to control the style of a web document in a simple and easy way. CSS defines how
HTML elements are to be displayed. You can add CSS in three ways: inline (using the style attribute
in HTML elements), internal (using a <style> element in the head section), and external (linking to
CSS selectors are used to select the HTML elements you want to style. Types of selectors include
element selectors, class selectors, and ID selectors. Properties are used to define the styles for the
selected elements. Examples include color, font-size, margin, padding, and border.
CSS allows you to style text by setting properties like font-family, font-size, font-weight, color,
h1 {
color: #333;
text-align: center;
The CSS box model describes the rectangular boxes generated for elements in the document tree.
It includes content, padding, border, and margin. CSS layout techniques include using display,
position, float, flexbox, and grid to control the layout of elements on the page.
Responsive design ensures that web pages look good on all devices. CSS media queries are used
body {
background-color: lightblue;
<!DOCTYPE html>
<html>
<head>
<style>
HTML & CSS Guide
h1 { color: #333; }
p { font-size: 14px; }
</style>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
}
HTML & CSS Guide
</style>
</head>
<body>
<div class='container'>
<div class='header'>
<h1>My Website</h1>
</div>
<div class='content'>
</div>
<div class='footer'>
</div>
</div>
</body>
</html>