Why can't I override display property applied via an asterisk?

Bhojendra Rauniyar

I want to hide all the elements in some screen resolution and just show the wanted element to be visible:

For instance:

*{
    display: none;
}
#block{
    display: block !important;
}

But this won't override the display property anymore. demo

Hashem Qolami

* targets all elements within the document, including html and body as well. That's why the content is still hidden - verify that.

If you want to select all elements within the <body> you should do that as follows:

body * {
    display: none;
}

#block {
    display: block;
}
<div id="block">block</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why can't I use Override annotation?

From Dev

Why I can't applied spacing between two divs

From Dev

Why can't I access the model's property via the lambda expression parameter?

From Dev

I'm getting a "Can't open display" message when logging in via putty. Why?

From Dev

Why can't I set this object property?

From Dev

Why I can't export the Linux DISPLAY?

From Dev

Maven - why can't I override the version of a dependencyManagement imported pom?

From Dev

Swift: why I can't call method from override init?

From Dev

Why can't I override my interface its methods?

From Dev

Why can't I override the method definition in the class(function) description?

From Dev

Why can't I override my interface its methods?

From Dev

Why can't I override "OnValidate()" in Unity3D?

From Dev

Android - why can't I override SeekBar's onProgressRefresh method?

From Dev

Can't override property of an JavaScript object

From Dev

How can I override property in this situation

From Dev

How to override a display:none property applied to parent element in specific child elements

From Dev

Can't override Excel shortcuts via VBA

From Dev

Why can't I set a JavaScript function's name property?

From Dev

Why can't I directly access a property of an object literal?

From Dev

Why can't I use "HasItems" property on ContextMenu with ItemsSource?

From Dev

Why can't I access meta from a property defined in setupController?

From Dev

Why i can't access protected property in the derived class

From Dev

Why can't I attach ToggleButton.IsChecked property to an Expander

From Dev

Why can't I customize the getter and setter if class property is atomic?

From Dev

Why can't I enumerate object property defined as not enumerable?

From Dev

Why can't I customize the getter and setter if class property is atomic?

From Dev

Why can't I access to a UserControl custom property inside a Repeater?

From Dev

Why can't I clear the background property (wpf control)

From Dev

Why can't I access a property of this destinationViewController that conforms to a protocol?

Related Related

  1. 1

    Why can't I use Override annotation?

  2. 2

    Why I can't applied spacing between two divs

  3. 3

    Why can't I access the model's property via the lambda expression parameter?

  4. 4

    I'm getting a "Can't open display" message when logging in via putty. Why?

  5. 5

    Why can't I set this object property?

  6. 6

    Why I can't export the Linux DISPLAY?

  7. 7

    Maven - why can't I override the version of a dependencyManagement imported pom?

  8. 8

    Swift: why I can't call method from override init?

  9. 9

    Why can't I override my interface its methods?

  10. 10

    Why can't I override the method definition in the class(function) description?

  11. 11

    Why can't I override my interface its methods?

  12. 12

    Why can't I override "OnValidate()" in Unity3D?

  13. 13

    Android - why can't I override SeekBar's onProgressRefresh method?

  14. 14

    Can't override property of an JavaScript object

  15. 15

    How can I override property in this situation

  16. 16

    How to override a display:none property applied to parent element in specific child elements

  17. 17

    Can't override Excel shortcuts via VBA

  18. 18

    Why can't I set a JavaScript function's name property?

  19. 19

    Why can't I directly access a property of an object literal?

  20. 20

    Why can't I use "HasItems" property on ContextMenu with ItemsSource?

  21. 21

    Why can't I access meta from a property defined in setupController?

  22. 22

    Why i can't access protected property in the derived class

  23. 23

    Why can't I attach ToggleButton.IsChecked property to an Expander

  24. 24

    Why can't I customize the getter and setter if class property is atomic?

  25. 25

    Why can't I enumerate object property defined as not enumerable?

  26. 26

    Why can't I customize the getter and setter if class property is atomic?

  27. 27

    Why can't I access to a UserControl custom property inside a Repeater?

  28. 28

    Why can't I clear the background property (wpf control)

  29. 29

    Why can't I access a property of this destinationViewController that conforms to a protocol?

HotTag

Archive