English 中文(简体)
DIV 在网页上没有显示
原标题:DIV not displaying at top of page
  • 时间:2011-09-11 16:08:12
  •  标签:
  • html
  • css

I ve创建了基本布局,网页上有2个链接、1个登记册和1个 log。

审视我的黑手脚联系,看看看它如何看待。 有一个黑色的盒子,即原木,你将看到绿箱和蓝箱,它们是我的 but子。

I need them at the top of the page.

http://jsfiddle.net/4EZa5/

不清楚我是否需要与安保部做些什么,才能使链接站在首页上?

传真:

<div id="accountLinks">
 <ul>
<li class="login"><a href="#">Log in</a></li>
<li class="register"><a href="#">Register</a></li>
</ul>
</div>

CSS:

#accountLinks{
float: right;
height:20px;
width: 170px;
margin: 0;
padding: 0;
 }
 #accountLinks ul{
list-style-type: none;
margin: 0;
padding: 0;
 }
 #accountLinks li{
float: left;
text-align: center;
 }
 #accountLinks .login{
background: url(../images/button_login.gif) no-repeat;
width: 70px;
height: 20px;
color: #FFF;    
  }
 #accountLinks .register{
background: url(../images/button_register.gif) no-repeat;
width: 70px;
height: 20px;
color: #FFF;    
 }

Thanks

最佳回答

阁下的H1标签是一个障碍,正在推倒。 仅增加浮动:左边;上下方1 c

h1{
width: 351px;
height: 49px;
background: #000;
text-indent: -9999px;
float: left;
}

To style the link only in login:

#accountLinks .login a {
    color: #FFF;    
}
#accountLinks .login a:hover {
    color: yellow;    
}
问题回答

通过<代码><h1>Sales板</h1>,可将其移至以下。 账户链接div, 或需要留在超文本中?

如果是的话,应确定账户链接:

#accountLinks{
    position: absolute;
    top: 0px;
    right: 0px;
    height:20px;
    width: 170px;
}

See this fiddle:

我在“id=“Links”后面添加了一种风格,这样就更便于定位,将含有标识等。

<h1>Salesboard</h1>
<div id="accountLinks" style="margin-top:-45px;">
<ul>
<li class="login"><a href="#">Log in</a></li>
<li class="register"><a href="#">Register</a></li>
</ul>
</div>

只剩下1头。

你们看着你们的联系,因为他们的浮游离! 贴在您的标签下

此外,text-intend (9999)将不显示任何案文。

Solution Newer browsers offer, the attribute fixed which will do exactly as it says.

添加<条码>:固定;

#accountLinks{
    position: fixed;
    top: 0px;
    right: 0px;
    height:20px;
    width: 170px;
}

#Container{
  width:100%;
}




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签