Design comparison
Solution retrospective
How do you get the button on the same line as the input ? Mine aren't lining up.
Community feedback
- @Saad-HishamPosted about 1 year ago
Hi Arianna! πββοΈ Congratulations on completing the challenge! To align the input and button on the same line just give the form flex property
form { height: 50px; display: flex; }
Keep up the great work and happy codingβ¨
1@unachozaPosted about 1 year ago@Saad-Hisham thank you for this comment, however adding
display: flex;
to the form element interferes with the<div class="error-message">
. the error message will show up inline with the input and button or if I addflex-direction: column
to the form, after the error occurs, all three elements are on separate lines. My hack fix was to move the error message out of the<form>
entirely. There has to be another way... thoughts?0@Saad-HishamPosted about 1 year ago@unachoza add these changes to your code the left prop on error message customize it as you desire
form { position: relative; }
.error-message { position: absolute; top: 51px; left: ; }
there also another way to make the error message is pseudo element using
::after
or::before
Marked as helpful1 - @khlifibrahimPosted about 1 year ago
i think the background and the text a little bit deferent from the main image but the design looks good keep going
0 - @VCaramesPosted about 1 year ago
Hey there! π Here are some suggestions to help improve your code:
Regarding your question, you will use
position: absolute
on the button andrelative
on theform
. You can then align the button usingtop
,left
, etc...- Currently, from 320px - 1000px your content is broken β οΈ with both mobile/desktop images displaying at the same time and content overlapping.
- For the image, I highly suggest using the
picture
element and allowing the browser to handled which image to show.
- Company logo
alt
descriptions should ALWAYS state the company's name.
- The
header
should be outside themain
element for semantic purposes.
- The heading "We're coming soon" should be wrapped in a
h1
heading.
- Your email
input
needs to have alabel
which you'll want to accessible hide.
- Your "thank you" and "error message" should be handled by your JS and they should be inside the form (you will also want to give them an
aria-live
to notify low vision users of changes and anaria-describedby
to link them to theinput
)
- Your email validation needs to be reworked, as it currently accepts
email@[email protected]
as a valid email.
- For you
widths
andheights
avoid using values such asvw;
orpercentages
as they can cause you to lose control of your content. Instead userem
orem
. More info on topic https://web.dev/learn/design/.
If you have any questions or need further clarification, feel free to reach out to me.
Happy Coding! πΎ
0 - @kabir-afkPosted about 1 year ago
Hey Arianna !!! , I hope you don't mind me forking your repo and making some desired changes , since I wanted to experiment with your code for valid enhancements . . .
0@unachozaPosted about 1 year ago@kabir-afk absolutely! looking forward to see what you come up with!
0@kabir-afkPosted about 1 year ago@unachoza I've opened a PR , feel free to ask questions where you feel like . . . I think I've done a decent job enhancing your code , initially I wanted to check whether I can produce the same error validation using
input type = "email">
, coz technically accessibility wise it should have beeninput type = "email">
, and I did , thnx to your proj , I got to know aboutnovalidate
attr . . . I also made your JS code short and conciseRegarding HTML and CSS β¨
Well ngl , and no-offense, but it was quite a mess , like your
<header>
was inside<main>
π π , which is not right, as according to navigational hierarchy<header>
/<nav>
comes first , then<main>
and then<footer>
, it was messing with the mobile design as well . . .so I fixed all things out which I felt faulty . . .hope you like it, happy coding !!! π₯0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord