我正在尝试制作一个原创的 tumblr 博客主题。这是我第一次从头开始写,虽然 CSS 对我来说并不陌生。然而,Z 索引...
简而言之,在每个帖子上,当光标悬停在帖子上时,菜单(例如,转发等按钮......)变得可见。抱歉,如果我的代码看起来很乱。
header
是整个页面的最高元素。里面的一切都是h2
按钮菜单,所以它应该一直在下面header
。
#top header{
font-family:"Open Sans Condensed", sans-serif;
font-size:3.5em;
padding:0px;
margin-top:-8px;
height:72px;
text-transform:uppercase;
color:#fff;
background-color:{color:Base};
width:100%;
text-align:center;
-webkit-box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, .6);
box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, .6);
-webkit-transition: all 3s ease-in-out;
-moz-transition: all 3s ease-in-out;
-ms-transition: all 3s ease-in-out;
-o-transition: all 3s ease-in-out;
transition: all 3s ease-in-out;
}
#post h2 {
float:left;
width:auto;
margin:5px 4px -130px -10px;
opacity:0.0;
position:relative;
z-index:2;
padding-left:5px;
font-family:"Calibri", sans-serif;
text-decoration:none;
-webkit-transition: all .6s ;
-moz-transition: all .6s ;
-ms-transition: all .6s ;
-o-transition: all .6s ;
transition: all .6s ;
}
#post h2 a{
color: #fff;
font-family:calibri;
}
#post h2 .item{
width:20px;
color:#fff;
background-color:#5C5C5C;
margin-bottom: 4px;
padding:3px;
-webkit-box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, .6);
box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, .6);
-webkit-border-radius: 4px;
border-radius: 4px;
text-align:center;
-webkit-transition: all .6s ;
-moz-transition: all .6s ;
-ms-transition: all .6s ;
-o-transition: all .6s ;
transition: all .6s ;
}
#post h2 .item:hover{
background-color:{color:Post Accent};
-webkit-transition: all .6s ;
-moz-transition: all .6s ;
-ms-transition: all .6s ;
-o-transition: all .6s ;
transition: all .6s ;
}
#post h2 {
color:#ccc;
margin-left:0px;
opacity:1.0;
z-index:2!important;
-webkit-transition: all .6s ;
-moz-transition: all .6s ;
-ms-transition: all .6s ;
-o-transition: all .6s ;
transition: all .6s ;
}
我很感激任何帮助!也请随时给我与您在上面看到的内容相关的任何提示。谢谢!
编辑:示例照片集帖子的 HTML 标记:
<div id="bin">
<div id="post">
<h2> <!-- permalink !-->
<div class="item" style="max-width:auto; width:auto;">{NoteCount} ♫</div>
<div class="item" style="padding-top:5px; padding-bottom:0px;">{LikeButton}</div>
<div class="item">{ReblogButton}</div>
<div class="item"><a href="{Permalink}">∞</a></div>
</h2>
<div id="photoset">
<div class="photoset">
{Photoset}
</div>
</div>
{block:Caption}
{Caption}
{/block:Caption}
<div id="date">
{TimeAgo}
</div>
</div>
</div>