0

I'm trying to fix an alignment issue that's caused by a row of social media share buttons, specifically the code generated by the Google+ button. I didn't set this site up and I'm not sure how the button was implemented, only know that it was part of an AddThis plugin or something.

The Google+ button seems to automatically generate a div with inline CSS styling:

<div class="google_plusone_iframe_widget" style="width:90px;height:25px;">

I need to get rid of the width and height, but how can I override it externally? I've tried the following but it didn't work:

div.google_plusone_iframe_widget[style] {width:auto!important; height:auto!important;}

Does anyone know how I can do that? Thank you in advance! Here is the page for reference, I am referring to the top left social media buttons:

http://www.canadianoutback.com/events/crime_investigators.php

5 Answers 5

2

Your CSS selector should be:

.google_plusone_iframe_widget {width:auto !important; height:auto !important;}

Remove that [style] attribute in your selector, and there's no need to specify the div tag.

enter image description here

Sign up to request clarification or add additional context in comments.

11 Comments

Thanks .. I've tried this before but it still doesn't work, because then this code just gets overwritten by the inline CSS that gets auto-generated. And I did notice the typo (missing T at the end), still does not work.
Yes, I know, that's the point. That's what I am trying to do. I can't just delete the [style] attribute because that code is auto-generated inline by the AddThis Google+ social media button. I am trying to get rid of the width and height it autogenerates through using external CSS to override it.
I was refering to [style] in your selector.
If you're not planning on changing that button later on, you can temporarily fix your problem with .addthis_button_google_plusone { width: 24px; height: 16px; overflow: hidden; }
That's what I thought you meant .. but yes I tried removing [style] selector and it did not work .. also tried your other temporary fix but that did not work either :(
|
1

Try to add this code #leftNav .addthis_toolbox .google_plusone_iframe_widget {width:auto!important; height:auto!important;} to make it.

1 Comment

Thanks .. I just tried it but unfortunately still not working :(
1

Could please try this once #leftNav a.addthis_button_google_plusone .google_plusone_iframe_widget[style] {width:auto!important; height:auto!important;}

1 Comment

Thanks again .. still no luck however :(
1

Please do try with this

 #leftNav a.addthis_button_google_plusone.at300b .google_plusone_iframe_widget {
    width: auto !important;
    height: auto !important;
}

Comments

1

If it is inside iframe we can't apply any style or script for it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.