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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top