Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatthew Murray
8,488 PointsSpaces in Wordpress
Hi, I'm having trouble making spaces (line breaks) in Wordpress. For example, if I want a space between the first <h1> tags and the first <p> tags the formatting automatically deletes the space.
I've tried using <br> and </br> and but none of them seem to work to make a simple break between the title and first paragraph. Does anyone know how to achieve this?
Thanks!
5 Answers
Matthew Murray
8,488 PointsHi James,
There really isn't any code to post. I'd like to make a space between the H1 and P tags.
For example:
<h1> Dogs</h1>
<br>
<p>There are many kinds of dogs... </p>
When I do this in wordpress wysiwyg then the br or /br tag won't work. Any thoughts on how I can make the BR tags take effect?
Thanks!
jeff creamer
23,733 PointsHey Matt,
- Are you trying to do this in your code or are you working in the visual/text editor section of your admin dashboard?
- Have you tried a non-breaking space, " " ?
Matthew Murray
8,488 PointsHi Jeff,
Thanks for the reply!
I'm working in the visual/text editor of the the admin dashboard in Wordpress. When I use a "</br> tag in the text editor then a space gets created, but it later disappears(!) the next time I log into the page.
I've tried the " " mark a couple of times. I've had some success, but just like with the "</br> tag the space created disappears shortly after I re-enter the same page for further edits.
I'm sure other wordpress users must have experienced this problem before. Anyone know how they resolve it short of putting a "." in the color of the background?
Thanks!
Zac Gordon
Treehouse Guest TeacherThe WordPress content editor is a little famous for stripping out code like this. If you're going to need to format your HTML like this, make sure to only use the Text editor version and not the visual editor.
Matthew Murray
8,488 PointsHi Zac,
Thanks for the suggestion. I'll give it a try and see what happens.
Cheers!
James Barnett
39,199 PointsJames Barnett
39,199 PointsPost your code