如何通过CSS将标题向前移动?

时间:2015-07-16 16:50:01

标签: html css z-index

我的网站出现问题

我需要标题才能出现,它在wordpress上运行是指向该网站的链接:http://goo.gl/E1ErzD

以下是使标题浮动的代码:

  #header {
  padding: 1.618em 0 0;
  margin-bottom: 3.631em;
  border-bottom: 4px double #e8e4e3;
  clear: both;
  position: fixed;

2 个答案:

答案 0 :(得分:1)

您需要设置z-index,并在标头中应用background-color,以便向前移动。您还应该考虑设置宽度:

#header {
 padding: 1.618em 0 0;
 margin-bottom: 3.631em;
 border-bottom: 4px double #e8e4e3;
 clear: both;
 position: fixed;
 z-index: 9999;/* set this to something high*/
 background-color:#fff; /* so you can see it is a block */
 min-width:100%; /* play with this too, and asdjust margins. check in IE - you may have to set a width rather then min-width*/

答案 1 :(得分:0)

将此添加到标题的css代码中:

z-index: 1;