Jump to content

HTML 5 Design Issue


Ashwini kaptiyal
 Share

Recommended Posts

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;


}

Link to comment
Share on other sites

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 :)

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...