Skip to content
English
  • There are no suggestions because the search field is empty.

Add a location dropdown to your website

Send patients straight to the right booking page at multi-location practices with sample HTML and CSS code you can copy, paste, and customize.

Overview

If your practice has more than one location, a location dropdown helps patients get to the right booking page in one click. Add a Select a Location button to your website's booking page, and patients choose their location from the list before they book.

This article gives you sample code you can copy, paste, and adjust to match your site. It works on any website builder that lets you add custom HTML and CSS, such as WordPress, Squarespace, or Wix.

Tip: For help adding the booking widget itself, see: Add the booking widget to a WordPress site.

Before you start

You'll need:

  • Access to your website editor, with permission to add custom HTML and CSS. If someone else manages your site, share this article with them.
  • The booking page URL for each location. If you don't have these handy, your account manager can share them.

How to add a location dropdown

The dropdown takes two pieces of code: CSS, which controls how it looks, and HTML, which creates the button and the list of locations.

Step 1: Add the CSS

  1. Open the page where you want the dropdown in your website editor.
  2. Copy the code below.
  3. Paste it either in the page's header, between the <head> and </head> tags, or directly above where you'll add the HTML in Step 2.
<style>
.dropdown {
  position: relative;
  display: inline-block;
}
.dropbtn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1em;
  padding: 8px 29px 8px 20px;
  background-color: transparent;
  border-radius: 5px;
  cursor: pointer;
}
.dropdown-content {
  display: none;
  position: absolute;
  z-index: 1;
  min-width: 275px;
  background-color: #ffffff;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
  display: block;
  padding: 10px;
  color: black;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  display: block;
}
.dropdown-content a:hover {
  background-color: #cccccc;
}
.dropdown:hover .dropbtn {
  background-color: #eeeeee;
}
</style>

Tip: Want to change the colors, size, or spacing? W3Schools' dropdown guide explains each setting.

Step 2: Add the HTML

  1. Go to the spot on the page where you want the Select a Location button to appear.
  2. Copy the code below and paste it there.
  3. Replace Location 1 through Location 4 with your location names.
  4. Replace each https://YOUR-BOOKING-PAGE-URL with that location's booking page URL.
  5. Add or remove <a> lines so there's one line per location.
  6. Save and publish the page.
<div class="dropdown">
  <button class="dropbtn">Select a Location</button>
  <div class="dropdown-content">
    <a class="locationLink" href="https://YOUR-BOOKING-PAGE-URL">Location 1</a>
    <a class="locationLink" href="https://YOUR-BOOKING-PAGE-URL">Location 2</a>
    <a class="locationLink" href="https://YOUR-BOOKING-PAGE-URL">Location 3</a>
    <a class="locationLink" href="https://YOUR-BOOKING-PAGE-URL">Location 4</a>
  </div>
</div>

Step 3: Test the dropdown

  1. Open the published page in a browser and on your phone.
  2. Click or tap Select a Location and make sure every location appears.
  3. Click each location to confirm it opens the right booking page.

Note: The button text says Select a Location. To change it, edit the words between <button class="dropbtn"> and </button>.

FAQs

Can I match the dropdown to my website's fonts and colors?

Yes. The sample uses your site's existing font. To change colors, update the color codes in the CSS, like #eeeeee for the button hover color and #cccccc for the location hover color.

Does the dropdown work on phones and tablets?

Yes. Patients tap Select a Location to open the list. Test it on a phone after you publish to make sure it looks right on your site.

How many locations can I add?

As many as you need. Add one <a> line per location in the HTML.

Where do I find each location's booking page URL?

Your account manager can share the booking page URL for each of your locations.