Design comparison
Solution retrospective
Can I improve this code ?
Especially for the responsive part, I think I can improve it.
Thks !
JJ
Community feedback
- @catherineisonlinePosted almost 2 years ago
Instead of using
<button class="process_btn"><a href="#">Proceed to Payment</a></button>
try to use only button tag or only a tag, don't use them together. a tag is usually goof if you are going to move to different page and button is good for submitting forms, for example, or for popups, modal, togging - something that doesn't redirect to somewhere else
Marked as helpful0 - @SinisaVukmirovicPosted almost 2 years ago
Hello!
Yes you can improve your code, any code can be improved.
Start by using more semantic elements not just <main> tag.
Also, to fix errors in your report, it cannot be link <a> inside of <button>. It is either-or. Either link or a button. Link shouldn't be inside of a button.
Some guideline when to use link and when to use button, are:
- Use link when clicking on it does something to change/affects the site. Change the page, modal pops up, something like that.
- Use button when clicking on it doesn't change/affects the side. Submit button of some form, something like that.
Hope this helps!
Marked as helpful0@JeremyPaymalPosted almost 2 years ago@SinisaVukmirovic Hello !
All right, I change and I left only the a tag. Thanks for the explanation.
For your first point, when you said that I have to use more semantic elements, you mean I should use them instead of using the div tag ?
Thanks !
JJ
0@SinisaVukmirovicPosted almost 2 years ago@JeremyPaymal Some instead and some to hold the DIVs inside of them. It depends on the structure of the site. Each site is different.
Marked as helpful0
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