Skip to content

Office Locations with City Photos

Bootstrap 5 contact section with four office cards showing a city photo, address, phone, email, live local time, open/closed badge and directions link.

Also known as: office locations section, multiple locations contact, contact page with offices, branch locations cards, company offices section

Office Locations with City Photos live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 contact section that lists your offices as photo cards, each with a city image, address, phone number, email, live local time, an open or closed badge and a directions link. Use it on contact or about pages for companies with several locations.

How it works

The root is a section.ol-offices with a heading row and a Bootstrap grid of four columns (col-sm-6 col-lg-3), so the cards stack on phones, sit two by two on tablets and line up in one row on desktops. Each card is an article.ol-card with h-100, so all cards share the same height and the .ol-btn directions button is pushed to the bottom with mt-auto.

The top of each card is .ol-media, a 3:2 box holding the .ol-photo image with object-fit: cover and an empty .ol-status badge. The body contains the .ol-role label, the city name, a semantic address element and the .ol-contact list with tel: and mailto: links.

The script finds every .ol-offices root on DOMContentLoaded and reads data-tz, data-open and data-close from each card. It uses Intl.DateTimeFormat with the card's time zone to get the local weekday and time, writes the time into [data-ol-time], reveals the hidden .ol-clock row and sets the badge text to "Open now" or "Closed". The ol-status--open class turns the badge dot green. It repeats every 30 seconds. Without JavaScript, the badge stays hidden through :empty and the clock row keeps its hidden attribute, so the card still shows address, phone and directions.

Customization

  • data-tz on .ol-card: any IANA time zone such as America/New_York; the local time and badge follow it.
  • data-open and data-close on .ol-card: opening hours in whole hours (24-hour clock). Saturdays and Sundays always count as closed in script.js.
  • --ol-accent in .ol-offices: changes the eyebrow, role labels, icons, link underline on hover and the button hover color.
  • --ol-bg and --ol-card: set the section background and card color.
  • --ol-radius: rounds the card corners; set it to .5rem for a sharper look.
  • aspect-ratio: 3 / 2 in .ol-media: use 16 / 9 for a shorter photo band.
  • col-lg-3 on the card columns: change to col-lg-4 for three offices per row.
  • The href of each .ol-btn: replace the map search query with your exact address or a place link.

The city photos come from Unsplash; replace them with photos of your own offices or cities.

Use cases

  • Contact pages: four office cards show city photo, address, phone and email
  • Multi-location companies: live local time and an Open now or Closed badge for each office
  • About pages: a directions link on every card opens the map
  • International teams: each office uses its own time zone and opening hours
  • Mobile visitors: cards stack on phones and sit two by two on tablets

Accessibility

Each card is an article labelled by its city heading through aria-labelledby. Addresses use the address element, and decorative Bootstrap Icons have aria-hidden="true". The directions buttons contain visually hidden text naming the office and warning that the map opens in a new tab. All links show a 3 px outline with :focus-visible, and :focus-within lifts the active card. Photos have descriptive alt text. Under prefers-reduced-motion: reduce the card lift and photo zoom are switched off.

Usage notes

Requires Bootstrap 5 (added automatically) and Bootstrap Icons. Several .ol-offices sections can share one page because each root is handled separately.

Office Locations with City Photos at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Contact Sections
License
Free for personal and commercial use

Questions about this template

Can I use the Office Locations with City Photos code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Office Locations with City Photos – Bootstrap 5 contact sections component screenshot
Office Locations with City Photos · Bootstrap 5 Contact Sections

More Contact Sections

Split Contact Section with Form – Tailwind CSS contact sections preview

Split Contact Section with Form

Tailwind CSS contact section with a gradient info panel beside a validated contact form, topic chips, character counter and a simulated send state.

Contact Section with Details – Bootstrap 5 contact sections preview

Contact Section with Details

Bootstrap 5 contact section with address, phone and email cards, copy buttons and a CSS map placeholder with opening hours.