如何将滑块浮动到页面的右侧

时间:2014-05-08 15:20:54

标签: php html css

screenshot

<form name="reg" action="signup.php" onsubmit="return validateForm()" method="post" class="address"style="text-align:left; padding:0px 0px; position: relative; margin-top:30px">
            <br /><br />
            <span>Name</span><input type=text name="name" id="name"><br /><br />
            <span>Age</span><input type="number" name="age" id="age"><br /><br />
            <span>Gender</span><input type="radio" name="gender" id="gender" value="male">Male<input type="radio" name="gender" id="gender" value="female">Female<br /><br />
            <span>Address</span><input type=text name="address" id="address"></br></br>
            <span>Email id</span><input type="email" name="email" id="email"><br /><br />
            <span>Contact No.</span><input type="number" name="contact" id="contact"></br></br>
            <span>User type</span><input type="radio" name="roles" value="doctor">doctor<input type="radio" name="roles" value="patient" checked="checked">patient
<input type="radio" name="roles" value="admin">admin</br></br>

            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="submit" class="button1">
        </form>

如何将滑块浮动到页面的右侧。应该添加什么属性?

3 个答案:

答案 0 :(得分:0)

您需要将float: right;添加到#hislider1

的样式中

答案 1 :(得分:0)

如何浮动:对吧?

#hslider1 {
    float:right;      

}

答案 2 :(得分:0)

您忘记关闭div标记。并在float:right; div中添加#hislider1更改您的代码,如下所示:

<div id="hislider1" style=" max-width:300px;max-height:300px; height:100%; float:right;">
  <form name="reg" action="signup.php" onsubmit="return validateForm()" method="post" class="address"style="text-align:left; padding:0px 0px; position: relative; margin-top:30px">
<br /><br />
<span>Name</span><input type=text name="name" id="name"><br /><br />
                <span>Age</span><input type="number" name="age" id="age"><br /><br />
                <span>Gender</span><input type="radio" name="gender" id="gender" value="male">Male<input type="radio" name="gender" id="gender" value="female">Female<br /><br />
                <span>Address</span><input type=text name="address" id="address"></br></br>
                <span>Email id</span><input type="email" name="email" id="email"><br /><br />
                <span>Contact No.</span><input type="number" name="contact" id="contact"></br></br>
                <span>User type</span><input type="radio" name="roles" value="doctor">doctor<input type="radio" name="roles" value="patient" checked="checked">patient
    <input type="radio" name="roles" value="admin">admin</br></br>

                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="submit" class="button1">
            </form>
</div>