I am currently working with three radio buttons that are initially aligned horizontally, but I would like to change their alignment to be vertical instead. What is the best way to achieve this?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.radio {
display: inline-flex;
align-items: center;
cursor: pointer;
margin-right: 10px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href = "style.css">
<title>Document</title>
</head>
<body>
<h1>Custom Radio Button</h1>
<label for="myRadioId" class = "radio">
<input type = "radio" name = "myRadioField" id="myRadioId" class = "radio__input">
Mercedes Benz
</label>
<label for="myRadioId2" class = "radio">
<input type = "radio" name = "myRadioField" id="myRadioId2" class = "radio__input">
BMW
</label>
<label for="myRadioId3" class = "radio">
<input type = "radio" name = "myRadioField" id="myRadioId3" class = "radio__input">
Volkswagen
</label>
</body>
</html>