gpt4 book ai didi

html - 在同一行中并排对齐文本字段和按钮

转载 作者:行者123 更新时间:2023-11-28 03:44:02 27 4
gpt4 key购买 nike

我需要始终并排放置一个文本字段和一个按钮。逻辑是这样的 - 按钮将始终位于屏幕的右侧。文本字段应占据左侧的其余宽度...我用过的代码

<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
</head>

<body>
<div data-role="page">
<div data-role="content">
<div style="display:inline;">
<input type="text" placeholder="Enter your user name"></input>
<a href="#" data-role="button" data-inline="true" class="normalBtn" style="margin-top:0px">Check</a>
</div>
</div>
</div>
</body>
</html>

此处演示 - http://jsfiddle.net/d7T4E/

最佳答案

我不确定,但你可以试试这个:

<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
</head>

<body>
<div data-role="page">
<div data-role="content">
<div style="display:inline;">
<input type="text" style="width:50% !important; float:left;" placeholder="Enter your user name"></input><a href="#" data-role="button" data-inline="true" class="normalBtn" style="margin-top:0px; float:left;">Check</a>
</div>
</div>
</div>
</body>
</html>

关于html - 在同一行中并排对齐文本字段和按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8112875/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com