CSS – Cascading Style Sheet
In this lecture you will learn handling div tags in CSS you will know
Definition and Usage
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!
Note: By default, browsers always place a line break before and after the div element.
To use div tag to apply styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.
for instance div tag in css examples with source code here:
The div element
This is a heading in a div element
This is some text in a div element.
This is some text outside the div element which is style not applied.
in the above shown example applied div tag to a html tag elements, in this example source code h2 tag is applied on style attribute with parameters are having with their values.
similarly second one p tag of html element is also applied for internal css style of color parameter with value