How to add a horizontal space with PHP?
-
Hello,
I know how to add a vertical space when needed between two items with PHP, but how is a horizontal space added between 2 items with PHP?
I have been trying different things and searching for an answer without any luck.
Thanks in advance for any information you are able to provide!
-
Add a CSS style to the output HTML and style that is what will work best.
Thanks for the information, however I don’t know a whole lot about code so could I kindly get some additional information around that?
Could you be very specific about where you require such space and include a site link – without we cannot answer such.
Sure.
<!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style "> <p style="padding-left: 15px;"><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_button_pinterest_pinit"></a> <div class="addthis_toolbox addthis_default_style"> <a class="addthis_button_linkedin_counter" li:counter="none"></a> <letter-spacing:15px;><a class="addthis_button_google_plusone" g:plusone:count="false"></a> <a class="addthis_counter addthis_pill_style"></a></p> </div> </div> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-518895bb724be09b"></script> <!-- AddThis Button END -->
I’m looking to get a space between the LinkedIn button, google+ button, and the share button. They are all very (too) close together for my taste.
And, I doubt anything can be done about it, but the facebook Like, Twitter Tweet, and PinIt buttons are too far apart.
The spacing between PinIt and LInkedIn are perfect.
If you still need a link to the site, let me know. Thank-you much!
and include a site link – without we cannot answer such.
Ok, here you go.
Please excuse the work-in-progress “dust” as I’m working on it to improve it…
Am reviewing now….Note: this works for a link using the ‘link’ above (highlight text ‘this’ click ‘link’ add url)… is a bit more ‘discrete’…
And once I see a pop up I resign the task…
I believe what you’re referring to is the aweber opt-in form. It’s easily closed with the ‘x’ in the upper right-hand corner.
Since aweber opt-in forms are very common, I’m confused why there’s an issue with it?
(P.S. And, yes I’m aware I could have put the link in text, but opted not to. I went ahead and changed it since it was still editable.)
OK, I’ve done some more research, and I’ve found a partial answer. On this website, they have spacing code listed, and one of them is & # x 0 0 A 0 ;
<Sorry for the spacing between the characters; I couldn’t get it to appear here any other way, even with using the code option.>When I put that before the +1 button code and after the +1 button code (but before the
</a>
, I get my desired space between LinkedIn and +1.However, when I do the same for the last code, the add_this counter code, it makes that button completely disappear. But, when I remove the code, that last button comes back only to not have a space between it and the +1.
Does anyone have any ideas?
Well, it’s not what I really want, but it’s what I can live with (at least for now, anyway).
Here’s how I’ve altered the above code:
<!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style "> <p style="padding-left: 15px;"><a class="addthis_counter addthis_pill_style"></a> ?<a class="addthis_button_facebook_like" fb:like:layout="button_count">?</a> ?<a class="addthis_button_tweet">?</a> <a class="addthis_button_pinterest_pinit"></a> <class="addthis_toolbox addthis_default_style"> <a class="addthis_button_linkedin_counter" li:counter="none"></a> ?<a class="addthis_button_google_plusone" g:plusone:count="false">?</a> </div></p> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-518895bb724be09b"></script> <!-- AddThis Button END -->
When I re-arranged what used to be that last button to make it the first button instead, the spacing code I found (and mentioned in my last post) is working between it and the facebook button when I put the code on either end of the facebook button.
I also needed to remove the div code before the LinkedIn button code so that LinkedIn wouldn’t appear on a 2nd line.
Now, I don’t know why there’s so much spacing around the Twitter button, but I can live with it for now if need be.
Does anyone have any other ideas on how to accomplish this or know how to eliminate some of the spacing around the Twitter button?
(Please note that I never put any spacing code around the Twitter button – it was just there by default for an unknown-to-me reason.)Edit: Well, for whatever reason, that spacing code I mentioned in my last post isn’t appearing there in the code box, but it is there!
i had a similar problem with Facebook & Google like and share buttons and I read somewhere that the share buttons are no more in use / supported. So I got rid of my share buttons. But that does not help you.
Then I put each button in its own table column <td>…</td> and set a width for each button column. This did not solve all the problems but it may work in your case.
What I discovered later was that the button sizes are different even though it looks like there is a white space on the right of the button. May be to display some counter later on … I do not know. This was the reason the <td>…<td> did not appear to work. It may appear to work if all the buttons were assigned a wider space. You may end up with two rows of buttons.
I really do not know if this experience would help you.
Thank-you for sharing your experience and providing me with another idea to try.
I did try a few different variations of table code, and unfortunately what ended up happening is that my 1st button was lower than everything else and then the 2nd button was higher than all the rest while all the other buttons were aligned correctly/evenly there-after.
I didn’t know what would need to be done in an attempt to correct that with the table codes I found, so I put my original code back for the time being.
Until I truly get social media up and going, I will just accept it as-is for the moment unless someone has other ideas?
Thanks very much for your time and patience in my response.
- The topic ‘How to add a horizontal space with PHP?’ is closed to new replies.