Menu

Building a Sticky Mobile Call Bar for a Law Firm Website
📰

Building a Sticky Mobile Call Bar for a Law Firm Website

DEV Community: css·SBD Marketing·2 days ago
#P0EHJLwO
#devtocss#devto#dev#call#number
Reading 0:00
15s threshold

Most visitors to a criminal defense website arrive on a phone, and many of them want to call rather than read. A sticky call bar, a strip pinned to the bottom of the screen with a tap-to-call button, is one of the most common patterns on law firm sites for that reason. It is also one of the most commonly broken. Bars cover footer links, collide with chat widgets, sit under the iPhone home indicator or hide the last line of every page.

This post walks through building one that behaves well: correct on notched phones, accessible, easy to measure and out of the way of the content. The examples use plain HTML and CSS with a few lines of JavaScript, so they port to any CMS or framework.

Start with the markup

Keep the bar simple. One primary action, the phone call, and at most one secondary action, such as a link to the contact form. Two buttons fit comfortably on small screens.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.