1

http://66.147.244.96/~safeedu2/wordpress/

Hello, I now have a clickable box (to the left) in the white area that will link to my homepage, but I want it to float on top of the "book logo", so it's not a white strip at the top of my design. Is this possible? Here is my new CSS:

/* =Header
-------------------------------------------------------------- */

#site-title {
    margin: 0;
    z-index: 6;
    width: 160px;
    width: 130px;
}

#site-title a {
    display: block;
    text-indent:-9999px;
}

#site-description {
    display: none;
    padding: 0px;
    margin: 0px;
}
4

1 回答 1

0

你应该阅读没有人告诉你关于 Z-Index 的内容

你有两个问题:

  • z-index如果该元素属于另一个下方的堆叠上下文,则使用巨大是没有用的。
  • 如果你想让一个空元素可见,你必须给它们提供尺寸(例如height: 100%;width: 100%;),并注意如果它默认是一个内联元素,你也需要display: block;(或inline-block),否则它会忽略尺寸。

你可以加

#site-title {
    margin: 0;
    z-index: 6; /* because #access has z-index:5 */
}

#site-title a {
    display: block;
    height: 100%;
    width: 100%;
}
于 2013-11-08T16:12:27.093 回答