I am using a facebook like button on my web page. I need it to align at the right side of the page. But there is a horizontal scroll bar displaying.
Please see the fiddle http://jsfiddle.net/u4kMs/
I couldn’t find out what causes this. How to fix this?
The scrollbar appears because the content is too wide for your screen.
Just omit the width on the
divelement, it will auto-expand to 100% of it’s parent. Floating the facebook button to the right like you already did should then align the button correctly without scrollbar.If you don’t get a satisfying solution you can still declare
overflow:hiddenon the containing div to supress the scrollbars.This would be the result: http://jsfiddle.net/poikl/u4kMs/8/