簡體   English   中英

如何使帶有文本,按鈕和文本框的div部分在所有屏幕尺寸上都能平穩響應?

[英]How to make this div section with text, button, and textbox responsive in all screen size smoothly?

我有@media的代碼,但它的對齊方式不太好。 希望您能幫助我將移動設備的內容從320px調整為767。 平板電腦則為768像素到800像素。 我的html代碼正確嗎? 我不能順利地對齊內容:(

html代碼:

<div class="container-fluid header-subscribe-section">
                <div class="container">
                    <div class="row">
                        <div class="col-md-7">
                            <p>
                                <span class="header-p-latestmenus font-Awesome white">Get our latest games in your inbox.</span>
                                <span class="header-p-subscribe font-GreatVibes white">Subscribe Now!</span>
                            </p>
                        </div>
                        <div class="col-md-5" id="mobile-enter-email">
                            <input type="text" name="lname" class="header-textboxemail font-Awesome white" placeholder="Email Address">
                            <button type="button" class="header-btsubscribe font-GaramondPremierePro">SUBSCRIBE</button>
                        </div>
                    </div>
                </div>
            </div>

CSS代碼:

.header-subscribe-section {background-color:#ad1f34; height:99.27px; width:100%}
.header-p-latestmenus{font-size:20px; letter-spacing:0.5px;}
.header-p-subscribe{font-size:28px; letter-spacing:0.5px;}
.header-btsubscribe{border-radius:4px; background-color:#831024; color:white; width:134.55px; height:44.19685px; width:146.19685px; border:none;font-size:18px;}
.header-textboxemail{width: 286.779527559px;height: 46.19685px;font-size: 17px;border: 0;}
.header-subscribe-section p{padding: 4% 14%;}

header-subscribe-section:可以為移動設備更改對齊方式

您可以將col-xs-36添加到您的父母div,通常我們在較小的屏幕中將輸入寬度設置為100%

將css文件中的width屬性更改為100%並刪除高度

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM