html – 对齐复选框旁边的文本

简单的问题,毫无疑问是一个简单的解决方案 – 尽管在搜索SO和谷歌一段时间后,我仍然很难找到它.

我所要做的就是获取文字片段“我对增强的列表或高级档案感兴趣,(我们团队的一名成员将及时回复更多信息)”并将其与支票右侧对齐框(文字左对齐),但不像现在一样环绕它.

这是我的JSFiddle

代码(使用PureCSS进行样式设计):

<form class="pure-form pure-form-aligned">
                    <fieldset>
                        <div class="pure-control-group">
                            <label for="name">Product Name</label>
                            <input id="name" type="text" placeholder="Username">
                        </div>

                        <div class="pure-control-group">
                            <label for="password">Contact Name</label>
                            <input id="password" type="text" placeholder="Password">
                        </div>

                        <div class="pure-control-group">
                            <label for="email">Contact Email</label>
                            <input id="email" type="email" placeholder="Email Address">
                        </div>

                        <div class="pure-control-group">
                            <label for="foo">Website</label>
                            <input id="foo" type="text" placeholder="Enter something here...">
                        </div>

                        <div class="pure-control-group">
                            <label for="foo">Description:</label>
                            <textarea id="description" type="text" placeholder="Enter description here..."></textarea>
                        </div>                      

                        <div class="pure-controls">
                            <label for="cb" class="pure-checkBox">
                                <input id="cb" type="checkBox">
                                I'm interested in an enhanced listing or premium profile,(a member of our team will respond promptly with further information)
                            </label>

                            <button type="submit" class="pure-button pure-button-primary">Submit</button>
                        </div>
                    </fieldset>
                </form>

任何帮助将非常感激.谢谢.

解决方法

这是一个简单的方法.可能还有其他人.
<input id="cb" type="checkBox" style="float: left; margin-top: 5px;>">
<div style="margin-left: 25px;">
     I'm interested in an enhanced listing or premium profile,(a member of our team will respond promptly with further information)
</div>

我使用div来“阻止”构造文本并将其移动到右侧.浮动:输入左侧保留复选框文本左侧(不在上方).输入上的margin-top调整顶部对齐文本.

fiddle.

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些