Forum

Thread tagged as: CKEditor

How to add empty pagargraphs

Hi I would like to add an empty paragraph between h3 and the p below.

h3. Background

p. TBR is a Global Ground Transportation Company with an obsession for quality control and service. Established in Glasgow in 1999, TBR has developed and expanded into a truly global organisation.

I tried using something like p. &nbsp, but It is diplaying the p. as text into my page. I also tried just p., got same results.

Lukasz Biegus

Lukasz Biegus 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you want to add spacing you should do that using CSS.

I can not use just an empty paragraph? so as to have: h3 title p empty p with text

Rachel Andrew

Rachel Andrew 394 points
Perch Support

That wouldn't be a usual thing to do. You should use a paragraph element to markup a paragraph. If you want visual space use CSS. Markdown and Textile will do the correct thing and remove empty paragraphs.

Sorry I am new in Perch, when you say use css, how do you mean it? I tried the code below but also didnt work tight.

h3. title <div style="height:20px;"></div> p. main text

Hi Lukasz,

I guess you may be in a hurry to get your project up and running but if you get a chance you should check out https://www.codecademy.com/ you will probably find the answer to your question within a few minutes and it will explain in more detail many aspects of CSS.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

We aren't able to teach CSS here. Dan's link would be helpful to you or any other basic CSS resource.

I know css I didnt know what html elements I am allowed to use inside perch editor I achived what I was looking by adding top margin to p thanks

I need to make the editor modified so as to force users to use as less code as possible since the website will be updated by non developers.

For example I have something like this

<p style="padding-top:20px;">TBR is a Global Ground Transportation Company with an obsession for quality control and service. Established in Glasgow in 1999, TBR has developed and expanded into a truly global organisation.</p>

Is it possible to add css to an element which is created by the editor? For example I have the paragraph below which was selected and added the p element by the tools of the editor

p. lorem ipsum dolor sit amet, consectetur adipiscing elit. In mattis suscipit neque, ultrices maximus nisi aliquam sit amet. Suspendisse potenti. Etiam tempus interdum faucibus. Maecenas vulputate nibh massa,

Is there any way to add css style directly to elements (placeholders) that are created by the editor? Or the user must do it with css like before by adding also the html element <p> (<p style="padding-top:20px;"> or <p class="sth">)

Drew McLellan

Drew McLellan 2638 points
Perch Support

Style it based on the container. e.g.

.article p {
    padding-top: 20px;
}

Again this wont help because I might have p inside the article that the user doesnt want the space, and also a p that he wants space. I guess the only way is by setting up class for specific porposes and aply it when wanted.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If there's no logic to when the spacing is needed and when it's not, a class would be the best way to go. That's sometimes a warning sign of a bigger problem - what are the rules for when the class is applied and when it's not? (rhetorical.)

So the user would just do this:

p(beat). lorem ipsum dolor sit amet, consectetur adipiscing elit. In mattis suscipit neque, ultrices maximus nisi aliquam sit amet.

Thanks Drew.