0

Is possible to submit button be at aright side of input, not below ? In code I copied form

<form action="/city" method="post">
    <fieldset data-role="fieldcontain">
        <input type="text" name="city_name" id="city_name" placeholder="City Name">
    </fieldset>
    <input type="submit" value="Create New City">
</form>

but button Create New City is always below.

4

4 回答 4

4

如果您无法修改 HTML,请尝试将此 CSS 添加到您的页面:

fieldset {
    display: inline-block;
}

示例小提琴

于 2013-01-03T11:28:53.210 回答
1
<form action="/city" method="post">
    <fieldset data-role="fieldcontain">
        <input type="text" name="city_name" id="city_name" placeholder="City Name">
        <input type="submit" value="Create New City">
    </fieldset>
</form>
于 2013-01-03T11:28:03.670 回答
1

像这样使用

<form action="/city" method="post">
<fieldset data-role="fieldcontain" style='display: inline'>
    <input type="text" name="city_name" id="city_name" placeholder="City Name">
</fieldset>
<input style='display: inline' type="submit" value="Create New City">
</form>

看演示

于 2013-01-03T11:28:51.790 回答
1

添加以下CSS

fieldset
    {
        display: inline;
    }

http://jsfiddle.net/tYsTd/

于 2013-01-03T11:31:02.410 回答