Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using bootstrap(Bootstrap v3.3.4) and in almost every browser it works,but in safari(5.1.7) it doesn's work. I am using this:
HTML
<button onclick="location.href='@Url.Action("Login", "Account")';return false;" class="btn btn-default btn-lg center-block">Log in</button>

So the button is placed in the centre of the screen, but in safari the button is not placed in the centre.

So how to fix this in safari?

This is my css:
XML
.center-block {
  display: block;
  margin-right:0 auto;
  margin-left:0 auto;
  text-align:center;
  margin: 0 auto !important;
   float: none !important;
}

Thank you
Posted
Updated 12-Apr-15 1:39am
v4
Comments
Sergey Alexandrovich Kryukov 10-Apr-15 12:53pm    
You need to show your CSS.
—SA
[no name] 11-Apr-15 8:41am    
How can I do that? it is very big file. Bootstrap.css
[no name] 12-Apr-15 7:40am    
I have post the css

1 solution

Oh my god. I found the solution!! but strange that the component .center-block in boostrap.css doenst work for safari. I just added this in my site.css:

CSS
.middle {
    display: inline-block;
    margin-right:0 auto;
  margin-left:0 auto;
    margin: 0 auto;
    width: 200px;
    float: none !important;
    display: block;

}


And it seems that it works now for all browers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900