HTML stands for HyperText Markup Language and CSS stands for Cascading Style Sheet. While HTML is used to define the structure of a document, CSS helps in defining the presentation and styling of the document's elements.
This is first paragraph inside the div.
This is second paragraph inside the div.
The font-size of this div is 30px
Descendant Selector:- The descendant selector matches all elements that are descendants of a specified element.
Space separated class/id/tags.
Eg.: div p
. This selects all the paragraph element inside
of all div element.
Child Selector:- The child selector selects all elements that are the children of a specified element.
'>' is used between class/id/tags.
Eg.: div > p
. This selects all the paragraph elements
that are children of div element.
Adjacent Sibling Selector:- The adjacent sibling selector is used to select an element that is directly after another specific element.
'+' is used between class/id/tags.
Eg.: div + p
. This selects all the first paragraph
element that are placed immediately after div elements.
General Sibling Selector:- The general sibling selector selects all elements that are next siblings of a specified element.
'~' is used between class/id/tags.
Eg.: div ~ p
. This selects all the paragraph element that
are next siblings of div elements.
HTML is used to define the structure of a document and CSS helps in defining the presentation and styling of the document's elements.
It's a linkPseudo-element is used to style specified parts of an element.
It can be used to: Style the first letter, or line, of an element.
Insert content before, or after, the content of an element.