设计一个浮动登录< div>问题 [英] design a floating login <div> issue

查看:84
本文介绍了设计一个浮动登录< div>问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以指导我设计一个登录div,如ups.com。只需去www.ups.com并点击登录按钮,然后浮动登录div出现。如何生成这种类型的div。请尽可能帮助我。感谢

can anyone please guide me to design a login div like ups.com. just go to www.ups.com and click on login button then a floating login div appear. how to generate this type of div. please help me if possible. thanks

推荐答案

将位置设置为固定 absolute ,并设置 top left 属性。看ups.com,他们使用这样的东西:

By setting position as fixed or absolute, and set top and i.e. left properties. Looking at ups.com they use something like this:

#loginform {position:absolute; left:409px; top:21px; width:270px; }

#loginform { position: absolute; left: 409px; top: 21px; width: 270px; }

在这之上,他们使用一个透明的gif箭头,然后一个div里面的灰色背景和边框的样式。

On top of this they use a transparent gif for the arrow and then a div inside with the styling of grey background and border.

编辑:

            <!DOCTYPE html> 
            <html> 
              <head>
                <style type="text/css">
                  header { background: black; color: white; padding: 2em;  }
                  #login { position: absolute; top: 5em; 
                  background: #eee; border: solid 1px #999; 
                  width: 200px; height: 200px; }
                </style>
              </head>
              <body>
                <header>
                  <button>Login</button>
                  <form id="login"></form>
                </header>
              </body>
            </html>

当隐藏或显示表单时,我认为JamWaffles的帖子是好的。 jQuery是几种方法之一,但可能是更好的一种。如果不是最好的。 ;)

When it comes to hiding or showing the form I think JamWaffles post is good. jQuery is one of several ways to go, but probably one of the better. If not best. ;)

这篇关于设计一个浮动登录&lt; div&gt;问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆