Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML CSS标签';s在div内(div有display:inline block;)出于某种原因添加了填充/边距?_Html_Css_Margin_Padding - Fatal编程技术网

HTML CSS标签';s在div内(div有display:inline block;)出于某种原因添加了填充/边距?

HTML CSS标签';s在div内(div有display:inline block;)出于某种原因添加了填充/边距?,html,css,margin,padding,Html,Css,Margin,Padding,小提琴手: ^^^将结果宽度滑动到左侧,以便将它们彼此相邻显示 代码: 帐户名: 电子邮件地址: 密码: 一些错误消息 其他一些错误消息 为什么在最后一句中E大写 为什么要在标签上添加填充/边距?它将它们向下推,而不是出于某种原因与顶部齐平没有填充边距问题,即对齐问题。。使用垂直对齐:顶部您的问题已解决 <div style="display: inline-block;vertical-align: top;"> <label>Account Nam

小提琴手:

^^^将结果宽度滑动到左侧,以便将它们彼此相邻显示

代码:


帐户名:
电子邮件地址:
密码:


一些错误消息
其他一些错误消息
为什么在最后一句中E大写

为什么要在标签上添加填充/边距?它将它们向下推,而不是出于某种原因与顶部齐平

没有填充边距问题,即对齐问题。。使用
垂直对齐:顶部您的问题已解决

<div style="display: inline-block;vertical-align: top;">
    <label>Account Name:</label> <br>
    <label>Email Address:</label> <br>
    <label>Password:</label>
</div>

帐户名:
电子邮件地址:
密码:
未填充边距问题,其对齐问题。。使用
垂直对齐:顶部您的问题已解决

<div style="display: inline-block;vertical-align: top;">
    <label>Account Name:</label> <br>
    <label>Email Address:</label> <br>
    <label>Password:</label>
</div>

帐户名:
电子邮件地址:
密码:
它不是边距或填充,只是遵循HTML规则

因为所有三个div都是内联块,所以它将显示在一行中

第二个块比另外两个块高,所以它显示如下

我认为最好更改html代码。
在同一组中创建相关控件。或者在将来,可能更难更改布局。

它不是边距或填充,只是遵循HTML规则

因为所有三个div都是内联块,所以它将显示在一行中

第二个块比另外两个块高,所以它显示如下

我认为最好更改html代码。
在同一组中创建相关控件。或者在将来,更改布局可能会更加困难。

您的Html代码格式不正确

HTML

<div style="position: relative;">

    <div  style="float:left; display:inline-block;">
        <label>Account Name:</label> <br/>
        <label>Email Address:</label> <br/>
        <label>Password:</label>
    </div>

    <div style="float:left;display:inline-block;">
        <form action="/webroot/NewUserSignUpProcess" method="post">
            <input type="text" name="txtAccountName"/> <br/>
            <input type="text" name="txtEmailAddress"/> <br/>
            <input type="password" name="txtPassword"/> <br/>

                        <input id="newSignupSubmit" type="submit" value="Submit"/>
        </form>
    </div>

    <div style="display: inline-block;float:left;">
        <label>Some error message</label> <br/>
        <label>Some other Error message</label> <br/>
        <label>Why was the E capitalized in that last sentence</label>
    </div>

</div>  

帐户名:
电子邮件地址:
密码:


一些错误消息
其他一些错误消息
为什么在最后一句中E大写
我已经格式化了


您的Html代码格式不正确

HTML

<div style="position: relative;">

    <div  style="float:left; display:inline-block;">
        <label>Account Name:</label> <br/>
        <label>Email Address:</label> <br/>
        <label>Password:</label>
    </div>

    <div style="float:left;display:inline-block;">
        <form action="/webroot/NewUserSignUpProcess" method="post">
            <input type="text" name="txtAccountName"/> <br/>
            <input type="text" name="txtEmailAddress"/> <br/>
            <input type="password" name="txtPassword"/> <br/>

                        <input id="newSignupSubmit" type="submit" value="Submit"/>
        </form>
    </div>

    <div style="display: inline-block;float:left;">
        <label>Some error message</label> <br/>
        <label>Some other Error message</label> <br/>
        <label>Why was the E capitalized in that last sentence</label>
    </div>

</div>  

帐户名:
电子邮件地址:
密码:


一些错误消息
其他一些错误消息
为什么在最后一句中E大写
我已经格式化了