¿Quieres añadir un salto de línea en WordPress o ajustar el interlineado entre bloques?
En la mayoría de los procesadores de texto, puedes añadir fácilmente espacios en blanco pulsando varias veces la tecla Intro. También puede crear líneas a doble espacio después de los párrafos desde las opciones de formato. Sin embargo, el editor de bloques de WordPress no tiene esos botones.
En este artículo, le mostraremos cómo añadir fácilmente un salto de línea en WordPress.
Antes de empezar, es importante saber que el espaciado entre líneas está controlado por el tema de WordPress que utilice.
Le mostraremos cómo añadir espacio entre bloques en el editor de bloques, y luego veremos cómo cambiar el interlineado en su tema si no está satisfecho con los resultados.
Tutorial en vídeo
Si no te gusta el vídeo o necesitas más instrucciones, sigue leyendo.
Añadir espacio de doble línea entre bloques
Cuando pulsa la tecla Enter para Windows o la tecla Return para Mac en su teclado para añadir un salto de línea, WordPress lo considera como un nuevo párrafo.
Esto significa que añadirá automáticamente el doble espacio entre líneas, siempre que su tema disponga del estilo necesario para ello (todos los buenos temas de WordPress lo tienen).
Basta con ir al editor de contenidos, pulsar la tecla Intro o Retorno después de la línea y escribir otra cosa en la línea siguiente.
Simplemente haciendo eso, basado en el estilo de tu tema, deberías ver una vaciada distinción entre párrafos.
Añadir espacio de una línea
Ahora bien, si está escribiendo algo como una dirección, probablemente querrá que aparezca a espacio sencillo en lugar de a doble espacio en su sitio de WordPress.
En este caso, tienes que pulsar la tecla SHIFT + ENTER en Windows o la tecla SHIFT + RETURN en Mac.
Esto le dirá a WordPress que quiere empezar una nueva línea dentro de un párrafo existente. Por lo tanto, necesita interlineado sencillo frente a interlineado doble.
Modificación de la altura y el espaciado de las líneas
A veces, aunque añadas el interlineado adecuado en el editor, no se muestra como quieres en tu tema.
Hay dos formas de corregirlo:
- Utilizar un plugin (de forma sencilla)
- Manualmente con código CSS (más avanzado)
Veamos primero el método fácil.
Añadir interlineado con un plugin
Si quieres hacer cambios de estilo en tu tema sin tener que aprender código, usar un plugin como CSS Hero es la mejor manera de hacerlo.
CSS Hero hace que sea fácil cambiar el diseño de su sitio de WordPress sin saber ningún código.
Puedes ver más detalles en nuestra reseña / valoración completa de CSS Hero.
Si quieres hacer cambios más grandes en tu tema, como mover una barra lateral o añadir un pie de página, entonces un plugin editor de arrastrar y soltar sería una mejor opción. Un plugin maquetador de páginas también te permitiría hacer pequeños retoques como cambiar los colores de las fuentes o añadir saltos de línea en WordPress.
¿No quieres usar un plugin, o sólo necesitas hacer este cambio? Entonces, la opción de código CSS manual puede ser la mejor para ti.
Cómo cambiar manualmente el espaciado entre párrafos con código CSS
Para añadir saltos de línea manualmente sin un plugin, necesitas añadir algo de CSS a tu tema.
CSS es básicamente como la característica de formato de Microsoft Word. En lugar de hacer clic en los botones, escribirá código CSS sin formato. No es tan aterrador como algunos principiantes pueden pensar. CSS es muy fácil de entender si sólo sigues las instrucciones.
Para añadir CSS personalizado a tu tema, necesitas visitar la página Apariencia ” Personalizar. Esto iniciará el Personalizador de temas de WordPress, donde debe hacer clic en la pestaña “CSS personalizado” de la columna de la izquierda.
Si no puedes ver estas opciones de menú, es posible que estés utilizando un tema de bloque. Consulta nuestro artículo sobre cómo corregir la falta de personalizador de temas en el administrador de WordPress.
En el cuadro CSS personalizado, debe añadir el siguiente código CSS:
.post p{line-height: 1.5em;}
La regla CSS mostrada arriba cambiará el interlineado del contenido del párrafo a 1,5em. Em es una unidad de anchura para tipografía.
Estamos utilizando la clase .post
, que WordPress añade automáticamente al área de contenido de todas las entradas para asegurarse de que solo afecta a las entradas y no a los párrafos utilizados en otros lugares.
Ahora bien, esto solo cambia el espaciado de interlineado simple.
Si desea cambiar el espaciado entre párrafos en WordPress (es decir, doble espaciado), entonces tendría que añadir relleno.
.post p {
line-height: 1.5em;
padding-bottom: 15px;
}
No dudes en ajustar los números a tus necesidades y añadir doble espacio en HTML.
También puedes añadir CSS personalizado a tu sitio utilizando el plugin WPCode. El plugin hace que sea muy fácil de insertar y gestionar el código en su sitio.
Para más detalles, consulte nuestra guía sobre cómo añadir CSS personalizado a su sitio de WordPress.
Esperamos que este artículo te haya ayudado a añadir un salto de línea en WordPress. Quizá también quieras consultar nuestra guía sobre cómo crear un blog en WordPress y los mejores servicios de marketing por correo electrónico para pequeñas empresas.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Ralph says
This was huge problem back in old creator. I never knew how it will look like and had to hit preview every couple of lines but i think with gutenberg it is way easier and i learnd to just use shift+enter. I do this automatically and almost without consciousness. Don’t know why but some websites don’t allow shift+enter only enter or not and then I’m like “WHY it is not working”!
Deepak Sahani says
Superb video & post solved my query.
WPBeginner Support says
Glad our guide could be helpful!
Administrador
Jennyfer says
Thank you very much for thus information! Very useful. Just what I was looking for.
WPBeginner Support says
Glad our guide was helpful
Administrador
Colleen Cochran says
I finally figured out the shift-enter thing for poetry single space lines, but when the post is published and emailed to followers, it loses formatting and all the lines run together. How do I fix that?
WPBeginner Support says
You would want to check with the tool being used to send the notification for the styling for fixing that issue.
Administrador
Luiz says
Thank you! Very useful!
WPBeginner Support says
You’re welcome
Administrador
Robin says
So helpful! Thank you!!
WPBeginner Support says
You’re welcome
Administrador
Dhirendra says
Any option for reduce image gap…
WPBeginner Support says
It would depend on the specific image but for a starting point to find what is causing the gap you would want to take a look at our guide below:
https://www.wpbeginner.com/wp-tutorials/basics-of-inspect-element-with-your-wordpress-site/
Administrador
jan van den hoed says
Thanks for the explanation. One question though. How can i do the same thing on a smartphone. I’m editing my blog on the way and do not have a laptop available. i tried to do shift enter but that did not work
WPBeginner Support says
Due to the limitations of mobile, you would likely need to use the CSS method.
Administrador
Val says
Thank you so much, such a great help. I agonized over spacing!
WPBeginner Support says
Glad our guide was helpful
Administrador
Stephen says
Thanks, it helped a great deal.
WPBeginner Support says
Glad our article was helpful
Administrador
Douglas Daniel says
To change the CSS it’s telling me I have to purchase a premium plan. Am I out of luck?
WPBeginner Support says
It sounds like you are on WordPress.com and this tutorial is for WordPress.org sites:
https://www.wpbeginner.com/beginners-guide/self-hosted-wordpress-org-vs-free-wordpress-com-infograph/
you would sadly be limited to the other options such as shift+enter to single line space the content.
Administrador
SOO says
Thank You! Helpful!!
WPBeginner Support says
You’re welcome, glad our article could help
Administrador
Rebecca says
I did not work for me. Any reasons it would not work?
WPBeginner Support says
If you’re using a page builder plugin they may have a different method for the single/double line spacing. Otherwise, it could be a plugin/theme conflict where you would need to disable your plugins and/or swap your theme to check
Administrador
Tim G says
I would like to reduce the spacing between normal paragraph lines — IMHO, there is too much white space by default. I’d also like to add a half line at the end of a paragraph, rather than a full line: WordPress by default seems to just do the equivalent of a double carriage return which is rather twentieth century and doesn’t emulate what Word can do. Any ideas?
WPBeginner Support says
You would want to reach out to the support for your specific theme and they should be able to tell you what CSS needs to be added to reduce your line spacing
Administrador
sofar ahmad says
TQ so much
very helpful
WPBeginner Support says
Glad our guide could be helpful
Administrador
Sumeet says
thanks that was what i was looking for it helped …
WPBeginner Support says
Glad our article helped
Administrador
Jen says
God bless you! I’m so grateful for you posting this with the CSS! Who knew that’s all it took for me to change the spacing! I’ve been looking for something like this for a long time! Thank you so much!
WPBeginner Support says
Glad our article could help you
Administrador
Kathy says
I am using the “shift” enter method but it does not allow for different size font when I do. Is there a work around?
WPBeginner Support says
Hi Kathy,
Please see our guide on how to change font sizes in WordPress.
Administrador
Lora Staples says
GREAT video. Loved the content, pacing, and tone of the speaker. THANKS!
Kunal Khandelwal says
Thank you so much for this suggestion. Didn’t know it was so easy