Target certain words with CSS?

前端 未结 3 1895

This is kind of a theory question but I wonder whether it is possible or not.

So if you have a div with some content like...

£100.00 - BUY<
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-21 04:37

    You can use this

    £100.00 - BUY

    CSS

    #price {  
     font-size: 2em; // double of the current font  
    }  
    
    div {  
    font-size: inherit; // get the font-size from the browser or the document.  
    }
    

    This will give the div a default font-size but the span with id price will have twice the font-size as the div.

提交回复
热议问题