Why do my spaces disappear?
-
Just to add one more “new” problem to my unsolved list…
When I am working on a new post, I will place spaces ( ) where needed. When I save, and then return to edit, they are gone.
Why is this happening?
The blog I need help with is: (visible only to logged in users)
-
Non-breaking spaces are automatically removed by the post editor.
If you need to create vertical or horizontal space I recommend using inline CSS styles. If you give me an example of what you’re trying to accomplish I’d be glad to help you with the specific code.
-
Just wanted to clarify that this is an issue on any WordPress site, including self-hosted sites. Spaces automatically removed as part of the core functionality of all WordPress sites.
-
-
I’m not sure which character you’re referring to because it’s being stripped out of the forum, just as it is in the post editor. I’m guessing that you’re using non-breaking spaces, which get stripped out, so yes, that’s wrong because it doesn’t work reliably, as you’re seeing. :) To add vertical space I’d recommend using inline margin style.
For example, let’s say you have two paragraphs that you’d like 100 pixels apart. You would switch to the Text/HTML editor and do something like this:
<p>This is the top paragraph</p> <p style="margin-top: 100px;">This is the bottom paragraph, which will be 100 pixels below the top one.</p>You can learn more about using CSS margin here:
-
-
the usual &xxxx;
If you mean a non-breaking space like & nbsp ; (I added spaces so it won’t get stripped out), that is not a reliable way of adding space in the post editor, and I recommend using the inline CSS method I suggested. No upgrade is needed to use this method and it won’t be stripped out.
If you need help with something specific, just link to the post and I’m glad to have a look.
-
Hmm, well okay. I learned something today. Seems like a lot of work though to have to type that every time you want a vertical space.
Thank you
-
If you show me what you’re trying to do specifically, I’d be glad to help. I noticed you have Custom Design upgrade on stoutstandards.wordpress.com so if you show me an example of where you’re always adding vertical space I can help you with the code that you would only need to add in your CSS editor once, and have it apply to multiple elements.
The specific CSS code will depend on what you’re trying to do, so could you provide a link to a post or page and show me where you want to add the space?
-
This was a case where I used the & thing. I can tell you however that I had to insert them and hit publish quickly. Otherwise they would not be there next edit, and I do a lot of edits.
I usually find that at the end of <div> I need to put a space. Likewise after photos, etc…
-
If you’d like to automatically add some space below all images in your posts, you could try adding something like this to your custom CSS, in the Customizer’s CSS panel:
.entry-content img { margin-bottom: 20px; }If you are adding divs within your content that you’d like to have the same amount of space below them, you could create a class for it. For example:
<div class="myspecialclass">My stuff here</div>Then you’d add a matching declaration in your custom CSS:
.myspecialclass { margin-bottom: 20px; }You can learn more about how to use CSS to control the look and feel of your site here:
https://dailypost.wordpress.com/2013/07/25/css-selectors/
http://en.support.wordpress.com/custom-design/how-to-find-your-themes-css/
https://cssworkshop.wordpress.com/And if you need further help, feel free to post in the CSS Customization forum:
https://en.forums.wordpress.com/forum/css-customization -
- The topic ‘Why do my spaces disappear?’ is closed to new replies.