Problem: Mobile Contact Button Visibility
Problem description
Given an HTML page with two contact elements:
<button class="mobile-contact">Contact Us</button>is a fixed-position button intended for mobile.<a class="footer-contact" href="mailto:info@example.com">Contact Us</a>is a link in the footer intended for desktop.
Write CSS to meet the following requirements:
The
.mobile-contactbutton should be visible when the viewport width is less than600pxand hidden when the viewport width is600pxor wider.The
.footer-contactlink should be hidden when the viewport width is less than600pxand visible when the viewport width is600pxor wider.The mobile contact button should be fixed at the bottom-right corner with a slight margin.
Do not modify the HTML, and do not use JavaScript.
Goal
Provide mobile users with a prominent, fixed “Contact Us” button while ensuring desktop users see a standard footer link instead.
Constraints
Only use CSS; JavaScript or HTML changes are not allowed.
Use exactly
600pxas the breakpoint.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.
Problem: Mobile Contact Button Visibility
Problem description
Given an HTML page with two contact elements:
<button class="mobile-contact">Contact Us</button>is a fixed-position button intended for mobile.<a class="footer-contact" href="mailto:info@example.com">Contact Us</a>is a link in the footer intended for desktop.
Write CSS to meet the following requirements:
The
.mobile-contactbutton should be visible when the viewport width is less than600pxand hidden when the viewport width is600pxor wider.The
.footer-contactlink should be hidden when the viewport width is less than600pxand visible when the viewport width is600pxor wider.The mobile contact button should be fixed at the bottom-right corner with a slight margin.
Do not modify the HTML, and do not use JavaScript.
Goal
Provide mobile users with a prominent, fixed “Contact Us” button while ensuring desktop users see a standard footer link instead.
Constraints
Only use CSS; JavaScript or HTML changes are not allowed.
Use exactly
600pxas the breakpoint.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.