css - Centralize a div with display-inline and affected by float -


I have this problem, I want to centralize a div inside a header, the problem is that: i Div (second use using a float left and float), see below:

  & lt; Header & gt; & Lt; Div class = "left" & gt; Hello World app left & lt; / Div & gt; & Lt; div class = "center" & gt; Center & lt; / Div & gt; & Lt; Div class = "right" & gt; Right & lt; / Div & gt; & Lt; / Header & gt;   

I try to use this CSS:

  header {width: 100%; Background color: black; Margin top: 50px; Text-align: center; }. Left {float: left; }. Center {display: inline-block; } .right {float: right; }   

but it did not centralize my center div (almost because it was not influenced by any other 2 div), what is the option here that I centralize this div ?

Try to float all divs left and setting width: 33% each .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -