想要向右移动特定的div [英] Want to move a particular div to right

查看:64
本文介绍了想要向右移动特定的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将特定的div再移至右侧,以便左侧的div有更多空间来显示其中的内容.

I want to move a particular div more to the right side so that the div in the left gets some more space to display the contents in it.

我在CSS中尝试了几件事,但是我知道我做错了事.

I tried few things in CSS, but I know I am doing something wrong.

在CSS中,我有...

In CSS, I have...

login-box {
    width: 200px;
    margin-left: 50px;
} 

推荐答案

您可以在特定的div上使用float,例如

You can use float on that particular div, e.g.

<div style="float:right;">

在div处也要增加左侧的空间:

Float the div you want more space to have to the left as well:

<div style="float:left;">

如果所有其他方法均失败,则将div放在正确的位置:绝对,然后将其按需要移动到正确的位置.

If all else fails give the div on the right position:absolute and then move it as right as you want it to be.

<div style="position:absolute; left:-500px; top:30px;"> 

等显然,将样式放在单独的样式表中,但这只是一个更快的示例.

etc. Obviously put the style in a seperate stylesheet but this is just a quicker example.

这篇关于想要向右移动特定的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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