I have a div container that displays content depending user status (logged in, anonymous). On each case, I need to move the bottom div below the content div, via CSS only. For example, for logged in user, I need to display both divs (.loggedInBottom, and .loggedIn), and .loggedInBottom div below .loggedIn div. I cannot move the div, but can change CSS to do so.
Both *Bottom divs need to have the same background colour as the container.
Web browser support: IE9+, FF, Chrome.
Any idea? Please provide cod. thanks.
<style type="text/css">
/*
Problem:
1: When loggged in, 1 needs to move below 4 via CSS only, not move div tag
2: Same as 1 above, Wwen not logged in, 2 needs stop move below 3 via CSS only
*/
.hide {
display: none;
}
.container{
background-color:grey;
width: 300px;
height: auto;
}
.loggedIn{
height: auto; //the height varies from time to time
}
.loggedInBottom{}
.anonymous{}
.anonymousBottom{}
</style>
<p>Logged In</p>
<div class="container">
<div class="loggedInBottom">bottom: When users are logged</div> <!--1 needs to move below 4 via CSS only-->
<div class="anonymousBottom hide">bottom: anonymous users</div> <!--2 -->
<div class="anonymous hide">Content: anonymous users</div> <!--3 -->
<div class="loggedIn">content: When users are logged. the height varies from time to time</div> <!--4 --> <!-- need to move this div tag to above 1 via CSS only -->
</div>
<p>anonymous users</p>
<div class="container">
<div class="loggedInBottom hide">bottom: When users are logged</div>
<div class="anonymousBottom">bottom: anonymous users</div> <!--2 needs to below 3 via CSS only-->
<div class="anonymous">Content: anonymous users</div> <!--3 -->
<div class="loggedIn hide">content: When users are logged</div>
</div>