Xiaojian Xiaojian - 4 months ago 13
CSS Question

How to display "divs" horizontally?

<div id="Content">
<div id="loginContent"></div>
<div id="signupContent"></div>
</div>


I have a root div here. I want to display the child divs horizontally. How to do this?

Answer

You mean this?

#loginContent,
#signupContent {
    float: left;
    width: 50%;
}

or

#Content {
  text-align: center;
}

#loginContent,
#signupContent {
    display: inline-block;
}