Hello all I am working on html and javascript.And I am going to ask a very basic question. I have written a simple code tried different thing.But unable to make it work my bad.
What I want to do is that I have a div which has two inner divs.Both inner divs has an svg element inside equal to the size of div.and I want both inner divs to be side by side.But my divs are not equal Ist div is big second is small in width.
<html>
<head></head>
<body>
<div position:relative; width = "100%"; height = "400px" float:left>
<div width = "1000px" height = "400px"; float:left>
<svg width = "1000px" height = "400px">
</svg>
</div >
<div width = "300px" height = "400px"float:left>
<svg width = "300px" height = "400px">
</svg>
</div>
</div>
</body>
</html>
How can I achieve this.
Also should i write height and width with both div and svg or it fine to use with only one
If you want the
divsto be equal in width, you’ll need to set theirwidthvalue to be equal. There are two ways of doing this. First, you could manually set the width:Or, you could just use percentages:
In both cases, if you want the divs to be side-by-side, one needs to be
float:rightand the otherfloat:left. There are other ways of accomplishing this butfloatsare simple.