Issue
have two datepickers, but they are arranged vertically. I would like to display these two calendar pickers in a horizontal layout with some spacing in between. How can I modify them to be presented in the same row horizontally?
How can I modify them to be in the same row?
Solution
Best way to place two div containers horizontal is to use
display : flex;
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Open Sans', sans-serif;
color: #222;
padding-bottom: 50px;
}
.container {
margin: 0;
display: flex;
flex-wrap: wrap;
}
.left{
margin: 5px;
background-color: aquamarine;
}
.right{
margin: 5px;
background-color: bisque;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="q2.css" />
<title>2 Datepicker</title>
</head>
<body>
<div class="container">
<div class="left">
<label>DatePicker1 : </label>
<input type="date">
</div>
<div class="right">
<label>DatePicker2 : </label>
<input type="date">
</div>
</div>
<script src="script.js"></script>
</body>
</html>
Answered By - ArthPatel02
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.