Ashwini kaptiyal Posted March 8, 2017 Share Posted March 8, 2017 Hi sorry for my poor english I have some confusion in my html5 designing. <html><head> <title> home product </title> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body> <div id="box"> <div id="box1"> <div id="part1"> use for cloth </div></div> <div id="box2"></div> </div> </body></html> #box {width:750px; height:600px; margin:auto; border: 5px solid black; } #box1 {width:300px; height:400px; margin-left:5%; border: 4px solid blue; margin-top:4%; display:inline-block; } #box2 {width:300px; height:400px; margin-left:2%; border: 4px solid green; margin-top:4%; display:inline-block; } Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 8, 2017 Share Posted March 8, 2017 Hi @Ashwini kaptiyal What is the problem you are having? What are you trying to do? Quote Link to comment Share on other sites More sharing options...
FakeWizard Posted March 8, 2017 Share Posted March 8, 2017 From the above provided example I can only conclude, that you'd like to have both boxes aligned in one row next to each other. Your approach was almost correct, you were only missing the float;left css property for both #box1 and #box2 elements. <html><head> <title> home product </title> <style> #box{ width:750px; height:600px; margin:auto; border: 5px solid black; } #box1{ float: left; width:300px; height:400px; margin-left:5%; border: 4px solid blue; margin-top:4%; display:inline-block; } #box2{ float: left; width:300px; height:400px; margin-left:2%; border: 4px solid green; margin-top:4%; display:inline-block; } </style> </head> <body> <div id="box"> <div id="box1"> <div id="part1"> use for cloth </div></div> <div id="box2"></div> </div> </body></html> One advice though, next time please elaborate a little bit more as what's the expected result or what the exact issue is , otherwise it's really hard to figure it all out. PS: Also putting your code into "code snippet" is always a good choice Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.