gpt4 book ai didi

html - 提交按钮旁边具有动态宽度的文本区域

转载 作者:行者123 更新时间:2023-11-28 07:22:55 24 4
gpt4 key购买 nike

我在左侧有一个文本区域,它应该使用大约 80% 的屏幕,在右侧的文本区域旁边有一个按钮。

当浏览器窗口变小时,文本区域应该变小,按钮应该保持在文本区域旁边的右侧。

不幸的是,当窗口太小时我的代码停止工作。

文本溢出也不起作用。

有什么想法吗?

谢谢!

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html, body { margin: 0; padding: 0; }
body, #content { width: 100%; }
textarea { width: 80%; }
button {
text-overflow: ellipsis;
display: block;
overflow: hidden;
white-space: nowrap;
}
</style>
</head>

<body>
<div id="content">
<textarea rows="10">x</textarea>
<input value="Submit Something" class="button" id="submitSomething" name="submitSomething" type="submit">
</div>
</body>
</html>

最佳答案

试试这个:

button {
text-overflow: ellipsis;
display: block;
overflow: hidden;
white-space: nowrap;
float: right;
right: 0;
position: fixed;
}

关于html - 提交按钮旁边具有动态宽度的文本区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31990213/

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