Making two HTML buttons go side by side

2019-02-17 02:09发布

Okay, I'm not very familiar with HTML, or how it comes together with CSS. I have been looking all over on how to make two HTML buttons go side by side. Here is the code I'm currently using.

<FORM METHOD="LINK" ACTION="LINK TO WEBSITE" target="_blank">
  <input type="submit" value="Forum Home Page">
</FORM>
<FORM METHOD="LINK" ACTION="LINK TO A DIFFERENT WEBSITE" target="_blank">
  <input type="submit" value="Skill Guides">
</FORM>

No matter if I put them right after each other or put an alignment infront of them. I can't seem to get them to go next to each other. I hope there is someone that can easily and in a detailed way, help me out.

标签: html button
3条回答
啃猪蹄的小仙女
2楼-- · 2019-02-17 02:30

You could also try wrapping them in a table tag. That's how I fixed my similar issue. The table automatically set them side by side.

查看更多
淡お忘
3楼-- · 2019-02-17 02:40

If I understand you correctly, you can just attach the following CSS:

form {
    display: inline;
}

As shown here: http://jsfiddle.net/zcz3j/

查看更多
唯我独甜
4楼-- · 2019-02-17 02:55

Demo http://jsfiddle.net/satinder_singh1/wr4Xv/1/

<div id="main">
<div class="floatdiv"><FORM METHOD="LINK" ACTION="LINK TO WEBSITE" target="_blank">
  <input type="submit" value="Forum Home Page">
</FORM></div>
<div class="floatdiv">
<FORM METHOD="LINK" ACTION="LINK TO A DIFFERENT WEBSITE" target="_blank">
  <input type="submit" value="Skill Guides">
    </FORM></div></div>​

<style type="text/css">
    #main
    {
    position:relative;
        width:200px;
    }

    .floatdiv
    {
    float:left;
        width=80px
    }
</style>

查看更多
登录 后发表回答