Vertically aligning text next to a radio button
Use it inside a label
. Use vertical-align
to set it to various values -- bottom
, baseline
, middle
etc.
http://jsfiddle.net/UnA6j/5/
Align text next to radio button
DEMO
.rButton {
width: 63px;
height: 52px;
vertical-align: middle;
}
.convText {
font-family:'Segoe UI';
font-size:20px;
vertical-align: middle;
}
Vertical-align docs
Vertical align text on radio input
Add this styling
.buttonsform label {
display: flex !important;
align-items: center;
justify-content: center;
}
Vertically align Radio Buttons
Using text-align: left;
with display: inline-block;
solved your problem
body { margin: 0px; background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%);}
#wrapper { padding-top: 0px; text-align: center; margin-top: -1%; margin-left: 20%; margin-right: 20%; background-color: white; clear: both;}
#quiz { padding-bottom: 10px;}
#quiz li { list-style-type: none;}
.question { padding-bottom: 10px; vertical-align: middle;}
.wrap { text-align: left; display: inline-block;}
<div id="wrapper">
<div id="quiz">
<form name="quiz" method="post" name="buttons" id="quiz" onsubmit="return false"> <li> <div class="question">1. How many continents are there?</div> </li> <input id="answer" type="radio" name="group1" value="wrong"> 6<br> <input id="answer" type="radio" name="group1" value="wrong"> 8<br> <input id="answer" type="radio" name="group1" value="correct"> 7<br> <input id="answer" type="radio" name="group1" value="wrong"> 5 <hr>
<li> <div class="question">2. Where is France located?</div> </li> <div class="wrap"> <input id="answer" type="radio" name="group2" value="correct">Europe<br> <input id="answer" type="radio" name="group2" value="wrong">Asia<br> <input id="answer" type="radio" name="group2" value="wrong">Antarctica<br> <input id="answer" type="radio" name="group2" value="wrong">North America </div> <hr> </form>
</div></div>
Vertically aligning radio buttons in center aligned text
You need to centre the div and then align your radios to that div so:
#main { text-align: center; margin: 0 auto;}
#radioDiv { margin: 0 auto; width: auto; text-align: left; display: table;}
<div id="main"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.<br/>
<div id="radioDiv"> <br/><input type="radio" name="example" value="x">x <br/><input type="radio" name="example" value="xx">xx <br/><input type="radio" name="example" value="xxx">xxx </div></div>
Related Topics
Do I Need to Generate a CSS File from Pygments for My Jekyll Blog, to Enable Colorful Code Snippet
(Css) Eliminating Browser's 'Selected' Lines Around a Hyperlinked Image
What Is the Use Case of :Host-Context Selector in Angular
How to Change the Play Icon of Embedded Youtube Videos
Flexbox Vertically Split Container in Half
Setting Up Auto Compile for Stylus
Change Background Color Every 30S (Fade Transition)
Bootstrap 3 Responsive Desktop and Mobile Layout
Is There a Maximum Length for the Class Name in CSS
Bootstrap3 .Visible-* .Hidden-* Display Inline
Flexbox Space-Between and Align Right
What's the Difference Between CSS Inherit and Initial
In CSS How to Change Font Size of H1 and H2
Using Mixins in Bootstrap 3 to Avoid Unsemantic Markup for Layout Structure
Set Color for Extra Page Parts Visible During Rubber Band Scroll
Is There Any Difference Between "Margin: 0 Auto;" and "Margin: Auto;"
If Multiple Sources Are Listed in an @Font-Face, Are All of Them Loaded on the Client Side