2个HTML按钮,我想在同一行上并排显示 [英] 2 HTML buttons that I want to be side by side on the same line

查看:4641
本文介绍了2个HTML按钮,我想在同一行上并排显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个HTML按钮,我想与第一个(Submit Request(s))按钮在同一行上并列排列,以便成为第一个。我遇到的问题是第二个按钮的顶部从底部按钮底部的底部开始。由于margin-left:50px元素,第二个按钮正确地向右移动。我列出了以下2个按钮的HTML:

I have 2 HTML buttons that I want to be side by side on the same line with the first (Submit Request(s)) button to be first. The problem that I am having is that the top of the second button starts where the bottom of the bottom button ends. The second button is correctly moved to the right because of the margin-left: 50px element. I have listed the HTML of the 2 buttons below:

<button style="float: left;" onclick="javascript:submitRequests();">
    Submit Request(s)
</button>
<button style="float: left; margin-left: 50px" 
        onclick="javascript:document.location.reload(true);">
    Reset
</button>


推荐答案

尝试使用Codepen或JsFiddle来添加代码或想法。

try before use a Codepen or JsFiddle to add your code or idea.

我建议你看看我的这个解决方案: http://cdpn.io/uKLga

I'm suggest you to see my porpose to this solution: http://cdpn.io/uKLga

您看到它很简单,您只需添加2个类并定义这些按钮类型(提交并重置)这些类可以帮助您逐个格式化。

You see it be simple you just add 2 class and define this buttons types (submit and reset) with these classes help you to format side by site.

这篇关于2个HTML按钮,我想在同一行上并排显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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