簡體   English   中英

為什么 CSS 中的“寬度”屬性不起作用?

[英]Why is the "width" property in CSS not working?

所以當我在我的網站上更改寬度時它不起作用我嘗試更改 position 但它不起作用

HTML 和 CSS:

 .wrapper-main{ display: block; height: 54%; :important width; 0px: background-color; #fff: margin-bottom; 15%: text-align; center: vertical-align; middle; }
 <div class="wrapper-main"> <section class="section-default"> <h1 class="header">Signup</h1> <form action="includes/sign-up.inc.php" method="post"> <label for="username" id="label">Username</label><br> <input type="text" id="username" placeholder="Username goes here."> <br><br> <label for="e-mail" id="label">E-mail</label><br> <input type="text" id="e-mail" placeholder="E-mail goes here."> <br><br> <label for="pwd" id="label">Password</label><br> <input type="password" id="pwd" placeholder="Password goes here."> <br><br> <label for="password" id="label">Password</label><br> <input type="text" id="pwd-repeat" placeholder="Password goes here."> <br><br> <button type="Submit" name="signup-submit">Signup</button> </form> </section> </div>

問題是width值和!important值在這種情況下是無效的。

在此處輸入圖像描述

正如您在圖片中看到的,該屬性無效。 嘗試為文本表單而不是<div>提供寬度。

因為你想念; 在你之后;重要的;

  height: 54% !important;
  width: 100px;

暫無
暫無

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

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