Override CSS property right to left

 

This case is an example on how to override CSS property right to left

We have this AdSense banner floating on the right side of the screen. What if you want to change it to the left
Recently, I installed Floating AdSense plugin for WordPress. It’s very helpful to add AdSense banner floating on the site.
However, this plugin floats the banner automatically on the right. Somehow, when the float option changed to left, it doesn’t work

The original code is look alike this one

#ad_divRight {
overflow: hidden;
border: 2px solid #3c95d9;
background-color: #fff;
right: 0px;
position: fixed;
top: 5%;
margin-left: 0px;
float: right;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #ffffff;
padding: 0 0 2px 0;
z-index: 10;
}

See right:0 , this forces banner ad to the right corner of the screen/site. We can override this alignment to the left with CSS with this code

#ad_divRight { left: 0 !important; right: auto !important; }

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: