I have HTML like this:
<div class = "address full">
I want to add css. How do I write a selector for a class with a space in it? This is not doing waht I want.
."address info" {
background: #eee;
}
You can't - there is no way of having a space within a single classname. So the element you've provided there doesn't have a 'class name with a space in it'. The element has two different classes address and full. You can of course target this element by specifying both classes like this:
.address.full{}
If you really want 'spaces' in your class name, you'll need another way of clarifying what you see as a space, such as hyphenation:
<div class = "address-full">
Or maybe camel-case
<div class = "addressFull">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With