edit css style of an element with a space in its class name

nkcmr picture nkcmr · Jan 14, 2011 · Viewed 27.9k times · Source

I'm creating a tumblr them and I have to write an external CSS file but I am having trouble editing the css style of the post elements.

This its structure:

<li class="post quote">
    {other code}
</li>


The problem is that the class name has a space in it.

How would I create a CSS class to access this? And yes, I know I can just put a style attribute in the element tag but I was kind of hoping for another option.

Answer

Pekka picture Pekka · Jan 14, 2011

The problem is that the class name has a space in it.

This is not possible in CSS. What you are doing is giving the element two classes.

You can address them such:

.post.quote { .... }

but in your case, it's probably better to use a valid separator like

post_quote