Frage

In one of my divs I need to put a title with a piece of text. But the title needs to be in 3 different sizes.

Like this :

Hello, my name is Anonymous

Do any of you have an idea? Because when I use different < p > classes, it starts a new paragraph.

War es hilfreich?

Lösung

<span style="font-family:BLA;">Hello,</span>
<span style="font-family:BLO;">my name is</span>
<span style="font-family:BLU;">Anonymous</span>

Andere Tipps

Use appropriate markup. You don't find multiple paragraphs inside a single sentence, so it makes no sense to use a <p>. Use elements that make sense.

Look at the reason you want to change the font, and use the markup the best describes it. Are you emphasising? Quoting? Defining? Or something else? If HTML doesn't have an element that describes your meaning, then use a span (it is a semantics-free generic element).

Then apply your styles to those elements (you might want to override the default styling on the elements first).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top