我该如何向右移动?

时间:2011-04-06 02:57:22

标签: html html5

我该如何向右移动?

<div class="contentcontainer med left">
            <div class="headings alt">
                <h2>Medium Width - Heading title here</h2>
            </div>
            <div class="contentbox">
                <form action="#">
                    <p>
                        <label for="textfield"><strong>Text field:</strong></label>
                        <input type="text" id="textfield" class="inputbox" /> <br />
                        <span class="smltxt">(This is an example of a small descriptive text for input)</span>
                    </p>
                    <p>
                        <label for="errorbox"><span class="red"><strong>Missing field:</strong></span></label>
                        <input type="text" id="errorbox" class="inputbox errorbox" /> <img src="img/icons/icon_missing.png" alt="Error" /> <br />
                        <span class="smltxt red">(This is some warning text for the above field)</span>
                    </p>
                    <p>
                        <label for="correctbox"><span class="green"><strong>Correct field:</strong></span></label>
                        <input type="text" id="correctbox" class="inputbox correctbox" /> <img src="img/icons/icon_approve.png" alt="Approve" />
                    </p>
                    <p>
                        <label for="smallbox"><strong>Small Text field:</strong></label>
                        <input type="text" id="smallbox" class="inputbox smallbox" />
                    </p>
                    <select>
                        <option>Dropdown Menu Example</option>
                    </select>  <br /> <br />

                    <input type="file" id="uploader" /> <img src="img/loading.gif" alt="Loading" /> Uploading...

                    <p> <br />
                        <input type="checkbox" name="checkboxexample"/> Checkbox
                    </p>
                    <p>
                        <input type="radio" name="radioexample" /> Radio select<br />
                    </p>

                </form>         
                <textarea class="text-input textarea" id="wysiwyg" name="textfield" rows="10" cols="75"></textarea>
                <p><br /><br />Buttons styles</p>
                <input type="submit" value="Submit" class="btn" /> <input type="submit" value="Submit (Alternative)" class="btnalt" />
            </div>
        </div>

3 个答案:

答案 0 :(得分:3)

尝试设置外部div的css'margin-left'属性,将其从屏幕左侧推开。

<div class="contentcontainer med left" style="margin-left: 200px;">

(将200更改为适当的数字)。

注意:尽量不要在最终产品中使用内联“样式”属性 - 将其放在外部样式表中:)

答案 1 :(得分:0)

如果你想将所有东西都移到右边,请使用css“float:right”。

例如:

<div class="contentcontainer med left" style="float: right">

答案 2 :(得分:0)

您可以使用CSS margin属性抵消设定金额:

<div class="contentcontainer med left" style="margin-left: 50px;">
相关问题