【问题标题】:Displaying form and button next to each other on w3css在 w3css 上并排显示表单和按钮
【发布时间】:2017-05-30 18:45:39
【问题描述】:

我在我的 codeiniter 项目中使用 w3.css,我想把它们放在一起。

这是我的代码:

<a type="button" class="w3-btn w3-blue w3-pull-left" href="http://localhost/cblog/posts/ikkinchi-post">Tahrirlash</a> 
<form action="http://localhost/cblog/posts/delete/2" method="post" accept-charset="utf-8">
    <input type="submit" value="O`chirish" class="w3-btn w3-red">
</formm>

【问题讨论】:

    标签: html css forms button w3.css


    【解决方案1】:

    为什么你的链接上有 type="button" 属性?

    要在一行上显示元素,请将其样式更改为:

    display: inline-block;
    

    或者如果你不需要填充

    display:inline;
    

    所以它看起来像这样

    a,form{
        display:inline-block;
    }
    

    【讨论】:

    • 不是回答((
    • 你能说得更具体点吗?
    • 我很笨?
    【解决方案2】:

    您可以查看 W3.css 的 documentation,看看是否有一个类可以使元素内联显示,并且可能使用为导航栏设计的类。如果没有,那么您可以自己创建一个类并将其分配给您想要的元素。

    .displayInline { display: inline;}

    【讨论】:

      猜你喜欢
      • 2014-10-03
      • 2021-01-23
      • 2019-03-10
      • 2013-12-06
      • 2014-05-04
      • 2018-08-23
      • 1970-01-01
      • 2016-12-29
      • 1970-01-01
      相关资源
      最近更新 更多