Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can several left an d right div in a container div

    can i put several left and right div in a container div . and also can I put
    4 div side by side in a container div

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,092
    Thanks
    23
    Thanked 593 Times in 592 Posts
    Yes:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Title of the document</title>
    <style type="text/css">
    .container{
    width:80%;
    height: 400px;
    background-color: blue;
    }
    .section{
    float:left;
    width: 13%;
    height: 350px;
    background-color: green;
    margin-right: 5px;
    
    }
    .goright{
    	float:right;
    	width: 13%;
    	height: 350px;
    	background-color: pink;
    	margin-right: 5px;
    	margin-left: 5px;
    }
    </style>
    </head>
    
    <body>
    <div class="container">
    <div class="section"></div>
    <div class="section"></div>
    <div class="section"></div>
    <div class="section"></div>
    <div class="goright"></div>
    <div class="goright"></div>
    </div>
    </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •