Double line spacing in all "description" question items?

Double line spacing in all "description" question items?

by Ahmad Amer -
Number of replies: 6

Hi

Is there a system-based procedure to make all "description" question items texts double-spaced?


Thanks

Average of ratings: -
In reply to Ahmad Amer

Re: Double line spacing in all "description" question items?

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ahmad,

Define a class with the desired line-height as follows:

.description * p { line-height: 1.8 }

where .description is the class of the description question and p is all the paragraph descendants of the ancestor .description.

With the Boost theme, for example, place the above line in Site Administration / Appearance / Boost / Advanced settings / Raw SCSS.

Reference: W3C - Selectors Level 3 - Descendant combinator

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Double line spacing in all "description" question items?

by Ahmad Amer -
Thanks Dominique
is the following syntax correct:

.description * p { text-align: justify; line-height: 200%; font-size: 13pt }
In reply to Ahmad Amer

Re: Double line spacing in all "description" question items?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't understand why the * is there. Surely it works (better) without it?
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Double line spacing in all "description" question items?

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ahmad,

The * makes p a grandchild or later descendant of .description. In fact, it not required and p could just be a child or later descendant. Therefore, as Tim suggested, it may be better to use the following line of code:

.description p { text-align: justify; line-height: 200%; font-size: 13pt }
Average of ratings: Useful (1)