is it possible to change style of some words in a paragaph with the help of css without using any html tag on those words

前端 未结 5 1353
醉酒成梦
醉酒成梦 2020-12-12 03:38

Is it possible? I want to change the style of some words in a paragraph with the help of css without using any html tag on those specific word. like , etc. Waiting for posi

相关标签:
5条回答
  • 2020-12-12 04:20

    without Tags it is not possible. even Jquery can not understand that what you want to change.

    0 讨论(0)
  • 2020-12-12 04:28

    No, it's not possible with pure css but there some pseudo-elements which have limited scope like

    :first-letter, :first-line

    0 讨论(0)
  • 2020-12-12 04:31

    CSS can select only elements and pseudo-elements. You cannot select words.

    0 讨论(0)
  • 2020-12-12 04:34

    Not possibble with only CSS, but with for example jQuery you can search some words into a text and change the style for example:

    $('p').html(html.replace(/world/gi, '<strong>$&</strong>'));
    
    0 讨论(0)
  • Not possible with only CSS. But you could use JavaScript to match specific words and dynamically wrap the words in an HTML element (e.g. a span), and style that with CSS.

    0 讨论(0)
提交回复
热议问题