Heim  >  Artikel  >  Web-Frontend  >  关于css相对浏览器的位置的问题,有图有代码,求大神分析!_html/css_WEB-ITnose

关于css相对浏览器的位置的问题,有图有代码,求大神分析!_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:11:33810Durchsuche


1,
上图中的登录框 我不管怎么用left:X 或者right:X 还是top:X 都改变不了位置 一直贴着最左边。
2,
用户名是贴着这个框的最顶部,我想让它往下面移动一点,除了直接
这种方法外还有没有更好的方法。

以下是代码:

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">










        

      

        

大婶你能登录吗?


            


            求你登录了!!!
            


        


        



            
            
            

       

            


            
            
       

            

       

       

        





   



回复讨论(解决方案)

.bg{margin:0px auto;width:600px;}
.row{padding:20px;}

.bg{margin:0px auto;width:600px;}
.row{padding:20px;}



第二个问题解决了,
但是加了.bg{margin:0px auto;width:600px;}
变成这样子

.container,.form-size{margin:0px auto;width:600px;}

.container,.form-size{margin:0px auto;width:600px;}



这样整个登陆界面就居中了,我能不能自己定义登录框水平的位置。

我在form-size里面设置left或者top等都没反应 这是为什么?

用margin定
margin-left
margin-top

用margin定
margin-left
margin-top


非常感谢!解决了 

这样整个登陆界面就居中了,我能不能自己定义登录框水平的位置。

我在form-size里面设置left或者top等都没反应 这是为什么?


left、top、bottom、right一类需要配合position使用。。。没有进行定位的情况下采用margin、padding一类进行处理位移。。


这样整个登陆界面就居中了,我能不能自己定义登录框水平的位置。

我在form-size里面设置left或者top等都没反应 这是为什么?


left、top、bottom、right一类需要配合position使用。。。没有进行定位的情况下采用margin、padding一类进行处理位移。。
好的
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn