Merge pull request #322 from linglejack06/main

05-Flex Modal: add comments and hints to solution files
This commit is contained in:
Cody Loyd 2023-06-08 14:00:26 -05:00 committed by GitHub
commit 4eea74d31f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
This one is another very common pattern on the web. The solution to this one is _simple_... but it might not be immediately obvious to you. You'll need to edit the HTML a bit to get everything where it needs to be.
### A hint
Depending on how you approach this one, you might need to revisit the `flex-shrink` property to keep a flex item from getting smashed.
Depending on how you approach this one, you might need to revisit the `flex-shrink` property to keep a flex item from getting smashed. In addition, pay attention to the structure of the html, specifically look into adding an additional container surrounding the header, button, main text, cancel, and continue divs; and look into moving the header div to encompass the button as well.
## Desired outcome

View File

@ -80,7 +80,7 @@ button.cancel {
/* this keeps the icon from getting smashed by the text */
flex-shrink: 0;
}
/* header container should be wrapped around the button element as well in order for flex style to work */
.header {
display: flex;
align-items: center;

View File

@ -10,7 +10,9 @@
<body>
<div class="modal">
<div class="icon">!</div>
<!-- additional container used here -->
<div class="container">
<!-- header div was moved to encompass the close button as well -->
<div class="header">Are you sure you want to do that?
<button class="close-button"></button>
</div>