Disable or reset a CSS rule

Css

Css Problem Overview


If define a CSS rule with top: 0;, how can I later disable or neutralise it in favor of bottom: 0; used elsewhere?

Css Solutions


Solution 1 - Css

do top: auto; bottom:0; - auto is the default value for top

Solution 2 - Css

top: auto;
bottom: 0px;

Solution 3 - Css

if you have the stretch issue just use initial to reset the rule

top: initial;

or

bottom: initial;

Solution 4 - Css

CSS is cascading, so for example, if you put p { top: 0;) first and p.bottom {top:auto; bottom: 0;) after that, your css will listen to the latter for p.bottom

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlenDelView Question on Stackoverflow
Solution 1 - CsstenfourView Answer on Stackoverflow
Solution 2 - CssJanView Answer on Stackoverflow
Solution 3 - CssLeoView Answer on Stackoverflow
Solution 4 - CssIliumView Answer on Stackoverflow