From 6a403f509a2331fa1db221078fbb289e0ab70726 Mon Sep 17 00:00:00 2001 From: Narendra Dhangar <161828345+narendra-dhangar@users.noreply.github.com> Date: Fri, 3 Oct 2025 08:35:36 +0530 Subject: [PATCH] Update general-sibling-selector.md --- .../combinator-selectors/general-sibling-selector.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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.