0

How to apply a CSS style to a small part of a paragraph?

I tried like this: ____________________ HTML: <p> Really <div class="test">cool</div> example. </p> CSS: .test { font-weight:bold; } ____________________ But the div element splits the text into multiple paragraphs. • Answered by -?-.

11th Nov 2016, 6:26 PM
Alexandre Balea
Alexandre Balea - avatar
3 Réponses
+ 3
Give the <div> "id" instead of "class".
11th Nov 2016, 7:12 PM
Riku Pepponen
Riku Pepponen - avatar
+ 2
you can use <span> instead of div or in your case simply put cool in <strong> tag
11th Nov 2016, 6:29 PM
Дмитрий Шкурко
+ 1
use <span> istead of div , or change ur coding,4 exmple , instead div on p and p on div,or giv div the id instead class!!!
11th Nov 2016, 7:53 PM
mr.default
mr.default - avatar