Reputation: 169
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...
<div>£100.00 - BUY</div>
Can you then target "£100.00" without targeting the rest?
So you can increase the font size of £100.00?
Upvotes: 3
Views: 8294
Reputation: 241248
You could target it by wrapping it in a span
element:
<div><span class="price">$100.00</span> - BUY</div
Upvotes: 4
Reputation: 15860
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.
Upvotes: 2
Reputation: 340055
No, that can't be done without wrapping the desired text in another element, typically a <span>
.
Upvotes: 5