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<
You could target it by wrapping it in a span
element:
jsFiddle example
<div><span class="price">$100.00</span> - BUY</div
No, that can't be done without wrapping the desired text in another element, typically a <span>
.
You can use this
<div><span id="price">£100.00</span> - BUY</div>
#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.