Skip to content

Instantly share code, notes, and snippets.

@rafaelcamargo
Created December 18, 2023 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelcamargo/82cd97cd55b5495b2d0570727b2aaf91 to your computer and use it in GitHub Desktop.
Save rafaelcamargo/82cd97cd55b5495b2d0570727b2aaf91 to your computer and use it in GitHub Desktop.
Using flexbox to make elements fill all the remaining space
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexbox</title>
<style>
html, body {
background-color: #e5e5e5;
}
form {
margin: 100px auto 0;
padding: 0 20px 0;
max-width: 800px;
}
.row {
display: flex;
}
input {
flex-grow: 1;
margin-right: 10px;
}
</style>
</head>
<body>
<form>
<div class="row">
<input type="search" required />
<button type="submit">
Search
</button>
</div>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment