- This topic is empty.
-
AuthorPosts
-
September 29, 2014 at 3:18 am #184936
web_editor
ParticipantHow to align buttons horizontally? I try to put this stuff, but its not working
overflow: hidden; margin-left:auto; margin-right:0px;
Here’s the link of the site where I have two buttons, please see the Calculator link
September 29, 2014 at 3:29 am #184937Paulie_D
MemberIt’s not clear what you mean but a reduced case in Codepen would be useful.
The buttons seem to be floated to the left so you might need to remove that.
September 29, 2014 at 3:37 am #184938web_editor
ParticipantI remove now the float, but still the button is not display in horizontally
September 29, 2014 at 3:43 am #184939Paulie_D
MemberI remove now the float, but still the button is not display in horizontally
With the float removed the
margin:0 auto
should now centre themSeptember 29, 2014 at 3:46 am #184940web_editor
ParticipantYes, it center already, but not horizontally align
September 29, 2014 at 3:55 am #184941Paulie_D
Membernot horizontally align
Perhaps you could explain what this means…align to what?
Do you mean next to each other?
September 29, 2014 at 6:46 pm #184998web_editor
Participantdisplay: inline-block;
I already have that, but still its not working
September 29, 2014 at 7:51 pm #185007__
Participant@web_editor, Paulie_D and Jerba have both asked you to explain what you mean by “horizontally align.” I would have assumed you were referring to the differences between:
<-- left <--> center <--> right --> <---- j u s t i f i e d ---->
…but your responses seem to indicate you’re talking about something else. Please explain in more detail, so we know what problem you are trying to solve.
September 29, 2014 at 8:16 pm #185011web_editor
ParticipantWhat I mean in horizontally align is I want the two button display in one line only like this
September 29, 2014 at 8:27 pm #185015chrisburton
ParticipantAh. You want them horizontally inline.
.calbutton, .resetbutton {display: inline-block;}
September 29, 2014 at 8:42 pm #185017__
ParticipantYes, but problem is the buttons are each wrapped in separate
div
s. They need to be adjacent (as they are in your codepen example) for this to work.<!-- effortless --> <input type=reset><input type=submit> <!-- difficult, impractical --> <div> <input type=reset> <span></span> <div class=clearer></div> </div> <div> <input type=submit> <span></span> <div class=clearer></div> </div>
Do you have control of the markup? It looks like it is programatically generated (e.g., by web publishing software or a plugin of some sort).
September 29, 2014 at 8:44 pm #185018web_editor
ParticipantI have that tag already, but the button is still not in-line :\
September 29, 2014 at 8:47 pm #185019__
ParticipantI edited my post above to clarify what I meant. Please have a look.
Again, do you have control of the markup? Can you make changes? You don’t need to add anything. You need to get rid of stuff and actually put the buttons next to each other.
As it is, you have a lot of markup that is specifically trying to prevent you from doing this.
September 29, 2014 at 9:21 pm #185021web_editor
ParticipantYes I have the control in markup. I have this
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.