etangins
etangins

Reputation: 624

How to Make Certain Phrases Appear on One Line Regardless of Screen Size

I have the following heading

<h2>John Smith Fine Art</h2>

How can I style this such that the phrase Fine Art is always on one line without having to change the font-size based on screen size? For example, as the window is made smaller (such as on an I-Phone), the heading may appear as

John Smith Fine
Art

I am OK with having

John Smith Fine Art

or

John Smith
Fine Art

but not when there is a line break between "Fine" and "Art" as with the first example. How can I achieve this? If "Fine Art" was all one word, that would achieve my goal so theoretically I could perhaps add a _ between "Fine Art" and style it with CSS so that it was invisible to give the effect of having a space, but that would affect my SEO.

Upvotes: 0

Views: 28

Answers (1)

porglezomp
porglezomp

Reputation: 1348

You should use an &nbsp; (non-breaking space) character in between the words to indicate that lines should not break there.

Example: <h2>John Smith Fine&nbsp;Art</h2>

Upvotes: 1

Related Questions