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.
Related Topics
CSS: Include CSS Stylesheets in HTML
Tutorial | 0 Comments
Website Performance: Deliver JavaScript and CSS files compressed to reduce loading times
Tutorial | 0 Comments
jQuery: CSS Stylesheet Switcher
Tutorial | 1 Comment
Reload Images, CSS, JS and Web Pages despite Browser Cache
Tip | 2 Comments
Darken Background of a Website (Gray Out Effect)
Tutorial | 0 Comments
Mouseover buttons using CSS without reloading
Tutorial | 0 Comments
CSS: Colorize Table Rows Alternately only with CSS
Tutorial | 0 Comments
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.
The default property of "position" is "static".
So, you can change your HTML in the following way:
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