newcoder1010 Posted March 23, 2017 Share Posted March 23, 2017 Hi, I have this html: <div class="form-actions"> <button class="webform-submit button-primary btn btn-default form-submit" type="submit" name="op" value="Get Your Fair Offer Fast!">Get Your Fair Offer Fast!</button> </div> https://drive.google.com/open?id=0B7xIEuVi005yTGFNYmtubm80aWc I would like to place the button in the center of the form-actions. I used the following css for other sites and worked. For this site the following code is not working. Please advise. css: .form-actions {width:200px; margin-left:auto; margin-right:auto;} Link to comment Share on other sites More sharing options...
davej Posted March 23, 2017 Share Posted March 23, 2017 .form-actions {width:200px; margin-left:auto; margin-right:auto; text-align:center;} 1 Link to comment Share on other sites More sharing options...
Ingolme Posted March 23, 2017 Share Posted March 23, 2017 Buttons are inline elements, so they need to be centered by setting text-align on the parent element. 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted March 23, 2017 Share Posted March 23, 2017 Being inline, width and margins to centre won't work, with your current code just add display: block; Link to comment Share on other sites More sharing options...
newcoder1010 Posted March 23, 2017 Author Share Posted March 23, 2017 Thanks. It worked. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now