Skip to content

[css -text-justify] How to NOT justify a piece of text inside a justified paragraph? #853

@ntounsi

Description

@ntounsi

NB. This issue may be raised elsewhere or may be related to another one. sorry if duplicate.

'Text-align : justify' [1] is a bloc property. It applies to block containers.

In general, the justify method is to vary inter-word spaces. Sometimes varying letter-spacing also.

For some reason (e.g. aesthetic, citation, need to keep original layout ...) one may wish to NOT justify a small sentence within a text, i.e. an inline span inside a justified paragraph. The 'text-justify : none' property [2] should permit this. Example:

<p style="text-align:justify">
    justified  justified  justified  justified  
        <span style="text-justify:none"> not justified not justified </span> 
    justified justified justified justified
</p>

However, the section 7.3 [2] says about 'text-justify ' property:
"Applies to: block containers and, optionally, inline elements "

What optionally means is explained next §:

"The property applies to block containers, but the UA may (but is not required to) also support it on inline elements."

Why not? Why not apply the property to inline element ALSO?

In some Arabic books/printings, one can find highly justified paragraphs containing a span of not-justified-text such as a sentence from the Koran for example.

[1] https://www.w3.org/TR/css-text-3/#text-align
[2] https://www.w3.org/TR/css-text-3/#text-justify

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions