Я хотел бы выровнять свои радио кнопки, используя CSS - PullRequest
0 голосов
/ 03 апреля 2020

Я пытался сделать анкетный опрос в html и css. Я хотел бы, чтобы мои радио кнопки были выровнены по вертикали, но я застрял, потому что я пытался некоторое время. Вот мой код:

<p>Choose your education level:</p>
<input type="radio" name="education" value="1">High School degree</input>
<br>
<input type="radio" name="education" value="2">College degree</input>
<br>
<input type="radio" name="education" value="3">Masters degree</input>
<br>
<input type="radio" name="education" value="4">PhD degree</input>

and my CSS code is:

input[type=radio] {
  text-align: left;
}

1 Ответ

0 голосов
/ 03 апреля 2020

Попробуйте этот код

input[type=radio] {
  vertical-align: middle;
  margin: 0 10px 0 0;
  }
<p>Choose your education level:</p>
<input type="radio" name="education" value="1">High School degree
<br>
<input type="radio" name="education" value="2">College degree
<br>
<input type="radio" name="education" value="3">Masters degree
<br>
<input type="radio" name="education" value="4">PhD degree
...