diff --git a/docs/css/selectors/combinator-selectors/general-sibling-selector.md b/docs/css/selectors/combinator-selectors/general-sibling-selector.md index b860b90..f89ce23 100644 --- a/docs/css/selectors/combinator-selectors/general-sibling-selector.md +++ b/docs/css/selectors/combinator-selectors/general-sibling-selector.md @@ -13,11 +13,13 @@ keywords: css combinator, css general sibling combinator, ] +hide_table_of_contents: true --- In CSS, the general sibling selector is used to select an element that is preceded by another element. The general sibling selector is represented by the `~` character between two selectors. +
## Syntax @@ -58,6 +60,7 @@ In the HTML code below, the CSS rule will apply the `font-weight: bold` property ::: +
## Example: Using General Sibling Selector @@ -109,7 +112,8 @@ Now, you can see the output of the above code in the Browser Window like this: In the above example, the CSS rule will apply the `font-weight: bold` property to the text inside the `

` elements that are preceded by an `

` element. +
## Summary -The general sibling selector (`~`) is used to select an element that is preceded by another element. It is less specific than the adjacent sibling selector (`+`) and more specific than the descendant combinator (` `). The general sibling selector is useful for styling elements that are not directly related but share the same parent. \ No newline at end of file +The general sibling selector (`~`) is used to select an element that is preceded by another element. It is less specific than the adjacent sibling selector (`+`) and more specific than the descendant combinator (` `). The general sibling selector is useful for styling elements that are not directly related but share the same parent.