html5 - how to center the div -


I want to put all contents of the div inside the container at the center. I tried to use the margin 0 auto and it did not work, how do I focus it?

  & lt; Div class = "container" & gt; & Lt; div class = "text-center" style = "margin: 0 auto; overflow: auto;" & Gt; & Lt; Div style = "float: left; width: 15%; margin-right: 2px;" & Gt; & Lt; Img src = "picture / Bruce-Crocker_311x312 (2) .jpg" class = "img-responsive" /> & Lt; Div class = "contenthover" & gt; & Lt; P & gt; bla & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div style = "float: left; width: 15%; margin-right: 2px;" & Gt; & Lt; Img src = "picture / Bruce-Crocker_311x312 (2) .jpg" class = "img-responsive" /> & Lt; div class = "contenthover" & gt; & Lt; P & gt; Bla & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

Can anyone help?

bootstrap center-block on any block elements that you center in Use text-center for text.

  & lt; Div class = "container" & gt; & Lt; Div & gt; & Lt; Img src = "picture / Bruce-Crocker_311x312 (2) .jpg" square = "center-block IMG-responsive" & gt; & Lt; Div class = "text-center" & gt; & Lt; P & gt; bla & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;   



Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -