【问题标题】:How to change CSS of blogger's first post only?如何仅更改博主第一篇文章的 CSS?
【发布时间】:2012-06-05 05:25:21
【问题描述】:

我只想在不使用 jquery 的情况下更改我博客的第一篇文章 (digitalsorify) 的 CSS,使其看起来像 The Huffington Post

【问题讨论】:

  • 你的意思是你想让第一篇文章是全角的?你不会通过修改你的css来做到这一点。您的 html 结构将需要更改。
  • 没错,但其余的博客文章看起来都是这样......CSS只修改了第一篇文章。

标签: javascript html css blogs


【解决方案1】:

回答标题(使用 CSS):

.wrapfullpost:first-child {
    /* put first post style here */
}

【讨论】:

  • thanx...这解决了问题,但另一边的小部件隐藏了内容...如何管理这个?
  • @zeeshanansari,为您的内容添加z-index: 999
【解决方案2】:

你可以这样做:

#content-wrapper { padding-top: 400px;}
.wrapfullpost:first-child { position: absolute;margin-top: -400px;}

经过我的操作,这看起来像 http://i.stack.imgur.com/lFWQA.png

【讨论】:

  • 我没有贬低你....我没有足够的声誉这样做...顺便说一句你的代码在打开帖子时中断...
  • 我不正确理解您的评论 :) 以防止更改您需要更改 html 的帖子。
  • 你可以把你的#main-wrapper放到另一个div上,只在主页上,只为此更改css:
    { content here}
    然后在 css 中写这样的东西: .someclass .wrapfullpost:first-child { position: absolute;margin-top: -400px;}
猜你喜欢
  • 1970-01-01
  • 2015-12-01
  • 1970-01-01
  • 2021-10-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多