Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I need to change the orientation of a set of radio buttons. I need to change them to horizontal instead of vertical. I have successfully changed the webform-form [nid].tpl.php theme file but I don't understand how to change the orientation of radio buttons. How can I do this.
g
Comments
Comment #1
gwlangie CreditAttribution: gwlangie commentedI really need some help getting the radio buttons to line up horizontally and not vertically. I have been successful at modifying the positions of edit boxes in my custom form but not the radio buttons.
Some guidance would be appreciated.
thanks
g
Comment #2
aaron1234nz CreditAttribution: aaron1234nz commentedIn the css try adding this:
.form-radios .form-item {
display:inline;
}
Comment #3
quicksketchComment #4
glennnz CreditAttribution: glennnz commentedThis works perfectly, except that I have a form in a node, and one in a block.
How can I get my node to display the radio buttons inline, and my block to display them vertically?
Thanks
Glenn
Comment #5
quicksketchTarget the block specifically with CSS.
Note that Garland does not have a "block" class on its blocks, but just about every other theme does, you might need to adjust the name of the class. This is a basic CSS question, I'd recommend looking at tutorials or a book on CSS. I like the http://w3schools.com website.
Comment #6
glennnz CreditAttribution: glennnz commentedGot this working
I had to specify both .node and .block CSS items:
Glenn
Comment #7
quicksketchComment #8
Hitmrrr CreditAttribution: Hitmrrr commentedHi!
css settings will be lost if one of the fields is not filled (required field), how can make whatever css settings were.
Comment #9
asim.shahzad CreditAttribution: asim.shahzad commentedThis really helped me in making radio buttons horizontaly align.
Comment #10
mahtab_alam CreditAttribution: mahtab_alam at Valuebound commentedThis worked for me..
Comment #11
danilosantosalvarado CreditAttribution: danilosantosalvarado commentedI managed to give styles to a radio button with the structure that gives drupal.
drupal structure.
Oranges
css:
.numero2 .radio input[type="radio"], .numero2 .checkbox input[type="checkbox"] {
display: none;
}
.numero2 .radio input[type="radio"], .numero2 .checkbox input[type="checkbox"] {
width: 15px;
height: 15px;
display: inline-block;
background-color: #fff;
box-sizing: border-box;
border: 1px solid black;
border-radius: 0px;
transition: border-color .2s;
margin: 3px 0px 0px -25px;
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
}
.numero2 .radio input[type="radio"]:checked, .numero2 .checkbox input[type="checkbox"]:checked {
background: url(../img/chulo.svg);
background-size: 100% 100%;
background-repeat: no-repeat;
}
Comment #12
apaderno