HTML basic syntax started with SHIFT+1 command.
div tag:The <div>tag defines a division or a section in an HTML document.
The <div>tag is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript.
The <div> tag is easily styled by using the class or id attribute.
Any sort of content can be put inside the<div> tag!
Example:
<html>
<head>
<style>
.myDiv {
border: 5px outset red;
background-color: lightblue;
text-align: center;
}
</style>
</head>
<body>
<div class="myDiv">
<h2>This is a heading in a div element</h2>
<p>This is some text in a div element.</p>
</div>
</body>
</html>
ATRTRIBUTES:
All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
The src Attribute
The <img> tag is used to embed an image in an HTML page. The src attribute specifies the path to the image to be displayed:
Example:
<img src="img_girl.jpg">
What is vh(view-port height)?
The vh unit in CSS stands for viewport height, representing 1% of the viewport's total height. It's used for responsive design, dynamically scaling elements based on the user's viewport height.
What is vw(view-port width) ?
The vw unit in CSS stands for viewport width, representing 1% of the viewport's total width. It's used for responsive design, scaling elements dynamically based on the width of the user's viewport.
Top comments (0)