Вёрстка адаптивной формы
Нужна блочная адаптивная верстка. На фото представлено то, как это должно быть с требованиями:
Не получается сделать именно верхний вариант:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MAKET_FORM</title>
<style>
.F {
line-height: 32px;
float: left;
width: 11em;
font-size: 20px;
}
.S {
line-height: 32px;
margin-left: 11em;
font-size: 20px;
}
#fifth {
display: inline-block;
width: 100%;
font-size: 20px;
}
#first {
font-size: 20px;
width: 100%;
}
#second {
font-size: 20px;
width: 100%;
}
.R {
width: 100%;
font-size: 20px;
}
#six {
font-size: 20px;
}
#third {
width: 14px;
height: 14px;
}
#fourth {
width: 15px;
height: 15px;
}
#fifth {
font-size: 20px;
}
p {
font-size: 20px;
}
}
@media all and (max-width: 600px) {
.F {
line-height: 32px;
font-size: 20px;
}
.S {
line-height: 32px;
font-size: 20px;
width: auto;
}
#first {
position: absolute;
bottom: 32px;
left: -11em;
width: auto;
}
}
</style>
</head>
<body>
<form method=post>
<p>Для публикации вашей статьи заполните, пожалуйста, следующую форму:</p><br>
<div id="P">
<div class="F">
<label for="first">Название статьи:</label><br>
<label for="second">Рубрика:</label><br>
<label for="third">Публикация:</label><br>
<label for="fourth">Разрешить комментарии:</label><br>
<label for="fifth">Текст статьи:<br></label>
</div>
<div class="S">
<input type="text" name="nam" id="first"><br>
<select name="head" id="second"><br>
<option value="1" selected id="second">программирование</option><br>
</select><br>
<input type="radio" name="answer" value="1" id="third"> на сайте
<input type="radio" name="answer" value="2" id="third"> в журнале
<input type="radio" name="answer" value="3" id="third"> на сайте и в журнале<br>
<input type='checkbox' name='agree' checked id="fourth">
</div>
<div class="R">
<textarea name="mytext" id="fifth"></textarea>
<input type="submit" value="Опубликовать" id="six">
</div>
</div>
</form>
</body>
</html>
Источник: Stack Overflow на русском