Line Spacing

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
williama
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 120
Joined: Sun May 18, 2008 10:01 pm

Line Spacing

Post by williama » Mon Mar 20, 2023 9:26 pm

Hi guys,

I would like to have the line spacing between lines, and between paragraphs the same. At the moment if I hit return to go to a new line, a big gap is added. I would like this gap to remain the same as any other line in a block of text. If I need a gap, I can just hit return twice and add a blank line.

I have used this piece of code, but it seems to effect both regular lines and paragraphs the same way, while still keeping their spacing different.

Code: Select all

p { line-height:15px; word-spacing: 0px; }
Is there a way to simply change the line spacing in JCE on the fly, or does it have to be done through the user.css file?
Many thanks.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30930
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Line Spacing

Post by Per Yngve Berg » Mon Mar 20, 2023 10:22 pm

Press shift + enter to add a line break <br> instead of a paragraph <p>

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2677
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Line Spacing

Post by ceford » Mon Mar 20, 2023 10:26 pm

You should use your browser Developer Tools to inspect a paragraph. The space below a paragraph is a margin-bottom css setting, 1rem in Cassiopeia template.css. Put a different value in user.css. Putting in blank lines to create space is bad practice!

williama
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 120
Joined: Sun May 18, 2008 10:01 pm

Re: Line Spacing

Post by williama » Tue Mar 21, 2023 12:10 am

Thank you both for the reply. See the image below for what I am trying to do.
desktop_20-03-2023_02.jpg
Basically I have a selection of articles being displayed in a category blog view, using the intro text to display an image which is used as a clickable link to the article, then a line of text for the title, and then a second for the projects status.

I have achieved this by setting the title line to 'definition term' in JCE, and the second line to 'definition description'.
The trouble is that I would like to add a third line, but even if I set that to 'definition description' too, a large gap is added between the second and third lines.

All I want to do here, is have three lines under the image that are the same distance from each other.

Hope that makes sense.
You do not have the required permissions to view the files attached to this post.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44092
Joined: Sat Apr 05, 2008 9:58 pm

Re: Line Spacing

Post by Webdongle » Tue Mar 21, 2023 12:38 am

Also JCE has a setting to change how a new paragraph is spaced
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2677
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Line Spacing

Post by ceford » Tue Mar 21, 2023 5:41 am

Try the suggestion from Per: Shift+Enter to insert <br> rather than <p>. That is how you would create a multi-line paragraph, such as an address. And look at the html output with Toggle Editor and with your browser Tools.

williama
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 120
Joined: Sun May 18, 2008 10:01 pm

Re: Line Spacing

Post by williama » Tue Mar 21, 2023 1:13 pm

Thanks for all the help, Shift+Enter does actually do what I need. Can't believe I did not know about that, but thank you for the help. :)


Locked

Return to “Templates for Joomla! 4.x”