Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何右对齐输入字段和左对齐标签? 联系页面 联系页面 联系方式_Html_Css - Fatal编程技术网

Html 如何右对齐输入字段和左对齐标签? 联系页面 联系页面 联系方式

Html 如何右对齐输入字段和左对齐标签? 联系页面 联系页面 联系方式,html,css,Html,Css,名字*: 姓氏*: 电话号码*: 无线电 联系许可证* 是 否 下拉列表 最佳联系时间*: 请选择 早晨 下午 傍晚 复选框 如何联系您 电话 电子邮件 不太清楚如何进行,我尝试在样式部分中执行文本对齐:左和文本对齐:右,但添加此选项时没有发生任何更改。我不知道还有别的办法。下面是我的外部css的JSFIDLE代码。任何帮助都将不胜感激删除文本对齐:居中代码,并改为使用: <html> <head> <link rel="stylesheet" href

名字*:

姓氏*:

电话号码*:

无线电 联系许可证*


下拉列表 最佳联系时间*: 请选择 早晨 下午 傍晚 复选框 如何联系您
电话
电子邮件


不太清楚如何进行,我尝试在样式部分中执行文本对齐:左和文本对齐:右,但添加此选项时没有发生任何更改。我不知道还有别的办法。下面是我的外部css的JSFIDLE代码。任何帮助都将不胜感激

删除
文本对齐:居中代码,并改为使用:

<html>
<head>
    <link rel="stylesheet" href="css/main.css">
    <meta charset="utf-8">
    <title> Contact page </title>
</head>
<body>
<div id="wrapper">  
        <header>
            <nav>
                  <ul>
                    <li> <a href="index.html"> Index </a></li>
                    <li> <a href="learning_log.html"> Learning Log </a></li>
                    <li> <a href="contact.html"> Contact </a></li>
              </ul>
        </nav>
    </header>



<h1> Contact page </h1>
<form> 
    <fieldset>
        <legend>Contact Information</legend>
    <p><label >first_name*: <input type="text" name="first_name*" required></label></p> 
    <p><label >last_name*: <input type="text" name="last_name*" required></label></p>
    <p><label >phone_number*: <input type="number" name="number*" required></label></p>    
        </fieldset>
        <fieldset>
            <legend>Radio</legend>
 <label >  contact_permission* </label><br>
     <input type="radio" name="rating" required value="1 hour"> Yes <br/>
 <input type="radio" name="rating" value="2 hours"> No <br/>  
            </fieldset>
        <fieldset>
        <legend>Dropdown List</legend>
        <label>best_time_to_contact*: </label>
<select required>
 <option value="">Please Select</option>
 <option value="1"> Morning</option>
 <option value="2"> Afternoon</option>
 <option value="3"> Evening</option>
</select>
        </fieldset>
        <fieldset>
            <legend>Check box</legend>
        <label > how_can_i_contact_you  </label><br>
<input type="checkbox" name="Phone" value="Phone"> Phone<br>
<input type="checkbox" name="Email" value="Email"> Email <br>
        </fieldset>

  <br>      



        <input type="submit" name="Submit" value="Submit">
    </form>
    </div>
    </body>
</html>
label {
   display: block;
   text-align: initial;
}
label>input {
   float: right;
}


FWIW,我也更喜欢使用
删除
文本对齐:居中代码,并改为使用:

label {
   display: block;
   text-align: initial;
}
label>input {
   float: right;
}


FWIW,我还更喜欢使用
将以下CSS添加到CSS文件中:

input {
  display: inline-block;
  position: relative;
}

label {
  display: inline-block;
  width: 200px;
  text-align: right;
}

将以下CSS添加到CSS文件中:

input {
  display: inline-block;
  position: relative;
}

label {
  display: inline-block;
  width: 200px;
  text-align: right;
}

谁是被赶下台的选民?这是一个公平的问题,尽管这个问题经常出现。可能是复制品。如果你要投否决票,请尊重地说出原因。谁是被否决的选民?这是一个公平的问题,尽管这个问题经常出现。可能是复制品。如果你要投否决票,请说明原因。注意:
initial
而不是用
text align:left替换它:)但他希望文本与输入右对齐。注意:
initial
而不仅仅是将其替换为
text align:left:)但他希望文本与输入对齐。