Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-03-2012, 12:02 AM   PM User | #1
davidduizer
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
davidduizer is an unknown quantity at this point
Side by Side buttons

Hey Everyone,

I'm not sure if this post is in the correct forum but I believe it will be simple for someone to solve.

I simply want to have my pinterest and facebook buttons side-by-sided (right now they are stacked).

Here is my code:

<?php $pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
<a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>&media=<?php echo $pinterestimage[0]; ?>&description=<?php the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a><div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>

Thanks in advance!

David
davidduizer is offline   Reply With Quote
Old 02-03-2012, 04:58 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Try
Code:
<a style="float:left" href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 02-03-2012, 05:39 PM   PM User | #3
davidduizer
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
davidduizer is an unknown quantity at this point
Didn't work

Thanks so much for the reply. It didn't seem to work though.

Here's an example URL:

http://www.damyhealth.com/2012/02/co...minute-recipe/

Thanks,

David
davidduizer is offline   Reply With Quote
Old 02-03-2012, 05:56 PM   PM User | #4
dylanbaumannn
Regular Coder

 
Join Date: Feb 2012
Location: Nebraska, USA
Posts: 132
Thanks: 8
Thanked 19 Times in 19 Posts
dylanbaumannn is an unknown quantity at this point
EDIT: i just looked at your code, you'll actually need to apply the float:left; to your <iframe> tag that you have & the <div> you have for your facebook button.

Code:
iframe{
float:left;
}
.fb-like fb_edge_widget_with_comment fb_iframe_widget{
float:left;
width:150px;
}
You also need to change the width of your "fb-like fb_edge_widget_with_comment fb_iframe_widget" <div> because it's sent to 450px right now, which is causing the button not to float since it cannot fit on the line above it. If you reduce the width to about 150px you should be fine.

Last edited by dylanbaumannn; 02-03-2012 at 06:03 PM..
dylanbaumannn is offline   Reply With Quote
Old 02-03-2012, 06:06 PM   PM User | #5
davidduizer
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
davidduizer is an unknown quantity at this point
doesn't work

That doesn't seem to work either. So they are just stacked really tightly both floating left.

David
davidduizer is offline   Reply With Quote
Old 02-03-2012, 06:10 PM   PM User | #6
dylanbaumannn
Regular Coder

 
Join Date: Feb 2012
Location: Nebraska, USA
Posts: 132
Thanks: 8
Thanked 19 Times in 19 Posts
dylanbaumannn is an unknown quantity at this point
the width of your iframe around your facebook button is still set to 450px, so it is unable to float next to your pintrest button.

You'll need to change the width of the iframe if you want the button to sit next to the pintrest button
dylanbaumannn is offline   Reply With Quote
Old 02-03-2012, 06:45 PM   PM User | #7
davidduizer
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
davidduizer is an unknown quantity at this point
level

They are on the same line now but not level. They seem staggered.

Any ideas?

Thanks!

David
davidduizer is offline   Reply With Quote
Old 02-03-2012, 07:55 PM   PM User | #8
dylanbaumannn
Regular Coder

 
Join Date: Feb 2012
Location: Nebraska, USA
Posts: 132
Thanks: 8
Thanked 19 Times in 19 Posts
dylanbaumannn is an unknown quantity at this point
I'm not entirely sure what all else you have going on, so the quickest fix I can think of would be to apply:

Code:
 
div{
margin-top:-3px;
}
it's a quick-fix that doesn't directly address the issue, but it'll fix it
dylanbaumannn is offline   Reply With Quote
Old 02-03-2012, 09:04 PM   PM User | #9
dylanbaumannn
Regular Coder

 
Join Date: Feb 2012
Location: Nebraska, USA
Posts: 132
Thanks: 8
Thanked 19 Times in 19 Posts
dylanbaumannn is an unknown quantity at this point
also, try adding:

Code:
position:relative;
to both of the iframe and the <div>.

Floating basically says, "hey, if there is room up to the left/right of you then you should sit there instead". However sometimes with statically positioned elements they will stop short of their desired position based on the previous element's height/content/whatnot. By changing the position to relative you're telling it to sit relative to where it should be instead of where it currently is.

Last edited by dylanbaumannn; 02-03-2012 at 09:08 PM..
dylanbaumannn is offline   Reply With Quote
Old 02-08-2012, 04:47 PM   PM User | #10
dylanbaumannn
Regular Coder

 
Join Date: Feb 2012
Location: Nebraska, USA
Posts: 132
Thanks: 8
Thanked 19 Times in 19 Posts
dylanbaumannn is an unknown quantity at this point
You got it working I see
dylanbaumannn is offline   Reply With Quote
Reply

Bookmarks

Tags
buttons, facebook, pinterest

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:47 AM.


Advertisement
Log in to turn off these ads.