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
Post a Comment