Created
December 18, 2023 01:54
-
-
Save rafaelcamargo/82cd97cd55b5495b2d0570727b2aaf91 to your computer and use it in GitHub Desktop.
Using flexbox to make elements fill all the remaining space
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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