Pergunta

Hello I want to give a different CSS style only for first post of my blog http://tutxtblogspot.com
Here I've used <b:if cond='data:numPosts != 0'>
Also I've used <b:if cond='data:post.isFirstPost'>
But I've failed to apply any style for the first post my blog.
Please help

Foi útil?

Solução

You can use pure CSS to target different children within a parent/child block of HTML.

HTML:

<div class="parent">
    <div>Blog one</div>
    <div>Blog two</div>
    <div>Blog three</div>
</div>

CSS:

.parent:first-child {
    background: red;
}

The CSS will only be applied to the first child.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top