Heading with line break
-
Hello, with long headings it can happen that they reach to the right margin and then wrap one or two words. However, this does not comply with the conventions for headings.
This ticket refers to the thread Heading with line break, and the following solution is more practical.
Headings cannot simply be wrapped without causing problems for the table of contents. This should therefore be implemented using CSS, as follows:
/* --- Heading with line break --- */ @media (min-width: 700px) { .long-heading { white-space: nowrap; } }
CSS-Media-Query
@media (min-width: 700px)
ensures that this class is only used on screens with a minimum width of 700 pixels.An example in HTML could look like this:
<h2 class="long-heading">If headings are long,<span class="nowrap">they reach the right margin</span></h2>
Headings that are to be wrapped are assigned the class
long-heading
, while the parts that are to be wrapped are marked within a span tag with the classnowrap
.The direct solution in HTML may no longer be ideal after a theme change. In such cases, the customizations should be checked and adjusted if necessary.
- The topic ‘Heading with line break’ is closed to new replies.