Visual inconsistency between `<a>` link and `<input type='submit'` button
Issue: "Log New Learning" link (<a>
styled as button) and "Delete Selected" button (<input type="submit">
) had slightly different heights/widths despite sharing similar CSS class (.button
).
Resolution: I added explicit box-sizing: border-box;
, line-height: 1.5;
, and vertical-align: middle;
to the shared CSS rule targeting both .button
and input[type="submit"]
.
Learning: I learned that link tags (<a>
) and submit inputs (<input type="submit">
) can have slightly different default browser rendering regarding padding inclusion (box-sizing
), line height, and vertical alignment. Explicitly setting these properties in CSS ensures visual consistency when styling different HTML element types to look like buttons.
Learned on: April 19, 2024
Edit