簡體   English   中英

有沒有辦法改變我制作的盒子表格的大小,當我有左邊的文字時,表格也可以在右邊嗎?

[英]Is there a way to change the size of the box form that I made, can the form also be on the right while I have left side text?

我怎樣才能做到這樣不僅我的表格很小,而且它在右邊,我可以在左邊放文字。 我在谷歌上找不到任何東西,所以我嘗試了這個。 我試圖對齊表單,但它僅適用於圖像。

#questions > .question, #languages > .language{
margin: auto;
overflow: auto;
padding: 8px;
width: 75%;
}
.choices > .choice, #languages > .language{
background: #ffffff;
border-radius: 8px;

opacity: 0.7;
overflow: auto;
padding: 16px;
}
#questions, #languages{
margin-bottom: 48px;
}
#languages > .language{
margin-top: 8px;
}
.language > img{
float: left;
margin-right: 24px;
padding: 
}

這僅適用於帶有SRC圖像而不適用於實際形式

是的,您可以更改表單,使標簽在右側,文本在左側,通過在整個表單上轉換比例,然后在單個元素上轉換以使其可讀。 它在下面的代碼中演示:

 .flip { -moz-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } .fName { width:90px; height:30px; display: inline-block; } .formBox { width:700px; height: 500px; background:grey; }
 <html> <head> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> <div class="flip"> <form class="formBox" action = "/cgi-bin/hello_get.cgi" method = "get"> <div class="fName flip"> First name </div> <input type = "text" class="flip" name = "first_name" value = "" maxlength = "100" /> <br /> <div class="fName flip"> Last name </div> <input type = "text" class="flip" name = "last_name" value = "" maxlength = "100" /> <input type = "submit" class="flip" value ="Submit" /> </form> </div> </body> </html>

對於改變表單的大小:聲明表單元素的高度寬度,然后使用 % 度量調整表單內其他元素的大小。

這就是我所理解的,你想要右側的表格和左側的文字。 然后先在html中制作一個容器,然后制作兩個div。 一為形式,一為內容。 然后使用寬度 50% 並向左浮動;

這是鏈接 - JsBin

html:

<div class="container">
  <div class="content">
    this is the content part
  </div>
  <div class="form">
    <form>
      <input type="text"/>
      <input type="text"/>
      <input type="text"/>
      <input type="text"/>
    </form>
  </div>
  </div>

css:

*{
  box-sizing: border-box;
}
.content,.form{
  width: 50%;
  float: left;
  border: 1px solid red;
  display: inline-block;
}
.form input{
  display: block;
}

暫無
暫無

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

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