Latest solutions
[Flexbox] - Responsive Article Preview Component __ BEM, CSS
#bem#animationSubmitted about 2 years ago
Latest comments
- @Saad-Hisham@Daviddp96
Love the sounds, the themes and the error notification.
Overall nice but you can't do operations like "2/0.2" so that might be worth checking out and fixing!
Nicely done!
Marked as helpful - @francismudzungayiri@Daviddp96
Hey there,
You could add flex to your left-box class!
Here's how:
.left-box { display: flex; flex-direction: column; align-items: center; justify-content: center; }
Now you'll notice the text below is moved left, but for that you just have to disable the transform you added
transform: translateX(38%);
When you want to center things within a small container such as this one, it's best to use flex, you could also use grid but I find this simpler.
Marked as helpful - @souravs97@Daviddp96
Hey there,
Here's the fix to your regular expression:
const mailFormat = /^[a-zA-Z0-9._]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/;
The difference is that now it includes
\.[a-zA-Z]{2,}
at the endThis ensures that the domain extension consists of at least two alphabetic characters. As a result, only email addresses with a valid domain extension like ".com", ".net", or ".org" will be considered valid.
Also since it's a submit button you could consider using the submit event instead of the click event.
Cheers
Marked as helpful