我已經創建了一個輸入字段和一個按鈕,但我想將該按鈕insiade輸入字段。我通過使用position:absolute
來完成它,但問題是它在中型或大型屏幕上無法正常工作。任何形式的幫助將不勝感激。這裏是我的代碼如何在輸入字段內添加一個按鈕
HTML代碼
<div>
<div style="float: left;width: 82%">
<input type="text" class="sent-message-text">
<img src="../img/camera.png" class="post-image-uploaad">
</div>
<div style="float: right">
<button class="no-button-design"><img src="../img/msg-sent.png" class="post-image-uploaad" style="margin-right: 15px;"></button>
</div>
</div>
</div>
CSS代碼
.fixed-bottom2 {
box-shadow: inset 0px 4px 5px #ededed;
padding: 9px;
margin:-20px !important
}
.sent-message-text {
border: 1px solid;
margin: 10px 0px 10px 15px;
min-height: 36px;
border: 1px solid #1486ab66 !important;
border-radius: 4px;
width: 92%;
}
.post-image-uploaad {
width: auto;
height: 22px;
margin-top: 8px;
}
.no-button-design {
padding: 0px;
border: 0px;
background-color: transparent;
margin: 0px;
}
.no-button-design img {
height: 34px;
}
在小屏幕上其完美的罰款
但在大屏幕它是從出來輸入欄位
我找到了一個類似的問題,也許這將幫助你: https://開頭計算器.com/questions/15314407 /如何添加按鈕的內部輸入 – VyoriX
是的我試過這個,但沒有在我的情況下工作。 –