From 507d51b356de707b5b8d3e1832fbf3684415f07c Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Wed, 28 Feb 2024 11:51:41 -0700 Subject: add example to post --- ...ntrol-element-under-another-element-html-css.md | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'Content/posts') diff --git a/Content/posts/2024-02-26-control-element-under-another-element-html-css.md b/Content/posts/2024-02-26-control-element-under-another-element-html-css.md index 1c253fe..cbdfe6a 100644 --- a/Content/posts/2024-02-26-control-element-under-another-element-html-css.md +++ b/Content/posts/2024-02-26-control-element-under-another-element-html-css.md @@ -33,3 +33,45 @@ In CSS, this can be done by: } ``` +Let us try this in a simple example. + +## Example + +Here, we create a button and overlay a transparent box + +```html +
+A box with 200px height and 200px width +
+ +``` + +
+ +
+A box with 200px height and 300px width +
+ +
+ +As you can see, you cannot click the button because the red box comes in the way. We can fix this by adding `pointer-events: none` to the box. + +```html +
+A box with 200px height and 300px width +
+ + +``` + +
+ +
+A box with 200px height and 300px width +
+ + + + + + -- cgit v1.2.3