css - Facebook Like Button Align Text In Iframe to the right -


I am using the button through an iframe like Facebook on my site.

Now you have to specify the width of the iframe such as because of the different languages ​​of the button, this means that I have to set the width to at least 70 pixels.

Now I want that once the button is aligned to the far right of my site, now I can do it by adding "text-align: right" in the CSS style of Iframe to do this iframe on right Shows, but not all the way on the right.

This is caused by the width of the iframe, 70px, and for example English like button is only 55px

Now what I want: The real content of the iframe is the actual iframe Align right.

I have created an example here on the right side of the Divive Build, its alignment, but because iframe is larger than the actual button, it is not entirely accurate I want to put the button on the right in the iframe.

I hope you can help people

CSS rule only iframe Element, not content of iframe, because it is completely another webpage.

  var cssLink = document.createElement ("link")  

You can use javascript to add 'CSS' to the stylesheet with the Iframe page:

  var cssLink = document.createElement ("link") CssLink.href = "style.css"; CssLink .rel = "stylesheet"; CssLink .type = "text / css"; . Frame ['frame1'] document.head.appendChild (cssLink);   

But I'm not sure that he will work on all browsers. Your best bet is to call the page with AJAX. This way you can modify the content of the page before displaying it

An example jquery AJAX function might look like this:

  $. Ajax ({type: "GET", Url: "facebookURL", data type: "html", success: function (html) {processData (html);}}); Function Process Data (FBData) {$ ('# Inject FBLCAR') Html (function () {Return Dollar (FBData) .Find ('#Plus Plugin') .HTML ();}); }   

Note that I have not tested it, only use it as a starting point or a guide

Comments