float step-down issue
-
Trying to create a horizontal row of buttons. Copied code from this page: https://www.w3schools.com/howto/howto_css_button_group.asp
but the buttons “step down” instead of lining up across in a row.
Put this in my theme’s child css page:
/*Format button group*/
.btn-group button {
float: left;
display: block;
vertical-align: bottom;
background-color: #dddddd; /* Green background */
border: 1px solid #333333; /* Green border */
font-size: 1.2em;
color: #dark gray; /* White text */
padding: 15px 30px; /* Some padding */
cursor: pointer; /* Pointer/hand icon */
}display: inline; /* Prevents “stepdown” */
/* Clear floats (clearfix hack) */
.btn-group: after {
content: “”;
clear: both;
display: table;
}.btn-group button:not(:last-child) {
border-right: none; /* Prevent double borders */
}/* Add a background color on hover */
.btn-group button:hover {
background-color: #3e8e41;
}
/*END Format button group*/and used this code:
<div class=”btn-group”>
<button>Hello</button>
<button>Samsung</button>
<button>Sony</button>
<button>Apple</button></div>Any ideas?
The page I need help with: [log in to see the link]
- The topic ‘float step-down issue’ is closed to new replies.