44 Votes

CSS: Reset property "position"

Question by Compi | Last update on 2022-04-24 | Created on 2016-02-21

I have created a class within an external stylesheet in which I have declared some CSS properties.

However, I would like to reset some of those properties to their defaults on one of my HTML pages using Inline-CSS. Among others, this also applies to the property "position". In my external stylesheet, I have set "position" to "fixed" and now I would like to reset it to its default behavior.

But what actually is the default value for "position"? I can exclude the values "absolute", "relative" and "fixed". So, should I reset to "initial", "inherit" or "static" to restore the default? I cannot see any difference between them.

ReplyPositiveNegative
2Best Answer4 Votes

The default property of "position" is "static".

So, you can change your HTML in the following way:

<div class="my_class" style="position:static">
   
</div>

This overwrites the "position" that might be defined in "my_class" with the default value.
Last update on 2022-04-24 | Created on 2016-02-21

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.