Utilizing both text content and a Google Maps Embed within a unified row container using Bootstrap framework

Trying to align text and an image side by side in a container while utilizing Bootstrap.

Example:

https://i.sstatic.net/63KZe.jpg

Blue = Device screen, Black = visible container

Encountering issues where the map embed shifts downward unexpectedly.

https://i.sstatic.net/k6Vhk.jpg

No visible margins or padding causing the shift, nor is it clear why the text displays as blue despite being set to black in the CSS.

HTML:

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="css/locations.css">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Locations | Location 1</title>
</head>
<body>
  <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <a href="../index.html">
      <img src="https://via.placeholder.com/100x40" alt="../index.html">
    </a>
    <ul class="navbar-nav ml-auto">
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle text-large nav-text-bold" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Locations</a>
        <div class="dropdown-menu text-mid" aria-labelledby="dropdown01">
          <a class="dropdown-item nav-text-bold" href="locations/location1/index.html">Location 1</a>
          <a class="dropdown-item nav-text-bold" href="#">Location 2</a>
          <a class="dropdown-item nav-text-bold" href="#">Location 3</a>
          <a class="dropdown-item nav-text-bold" href="#">Location 4</a>
        </div>
      </li>
      <li class="nav-item">
        <a class="nav-link text-large nav-text-bold" href="#">Media</a>
      </li>
      <li class="nav-item">
        <a class="nav-link text-large nav-text-bold" href="donate/index.html">Donate</a>
      </li>
      <li class="nav-item text-large">
        <a class="nav-link nav-text-bold" href="#">About</a>
      </li>
    </ul>
  </nav>

  <br>
  <br>

  <div class="container">
    <div id="content">
      <div class="jumbotron row" style="display:flex">
        <div class="col-md-6 m-3 text-info">
          <p>1600 Pennsylvania Ave NW, Washington, DC 20500</p>
          <p>Open Weekdays sometime to sometime</p>
          <p>Tel:
          <a href="tel:555-555-5555"><b>555-555-5555</b></a></p>
        </div>

        <div class="col-md-6 maps-embed mt-3 text-right">
            <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3105.1501993708266!2d-77.03871848469284!3d38.89768045453255!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89b7b7bcdecbb1df%3A0x715969d86d0b76bf!2sThe%20White%20House!5e0!3m2!1sen!2sus!4v1574888816470!5m2!1sen!2sus" width="400" height="300" frameborder="0" style="border:0;" allowfullscreen=""></iframe>
        </div>
      </div>
    </div>
  </div>   
<br>
<br>

<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

</body>

CSS: (locations.css)

.container{
  text-align: center;
}

.jumbotron{
  padding-left: 10px;
  padding-right: 10px;
}

.text-info{
  color: black;
  text-align: left;
}

.maps-embed{
  text-align: right;
}

.headerText{
  padding-top: 10%;
}

.text-mid{
  font-size: 120%;
  text-decoration: underline;
}

.text-mid:hover::after{
  text-decoration: underline;
}

.text-large{
  font-size: 140%;
  text-decoration: underline;
}

.text-large:hover{
  text-decoration: underline;
}

.nav-text-bold{
  font-family: 'Roboto', sans-serif;
}

Attempting to apply Bootstrap Grid system for better alignment. Any insights on how the grid can be integrated further?

Answer №1

.container{
  text-align: center;
}

.jumbotron{
  padding-left: 10px;
  padding-right: 10px;
}

.text-info{
  color: black;
  text-align: left;
}

.maps-embed{
  text-align: right;
}

.headerText{
  padding-top: 10%;
}

.text-mid{
  font-size: 120%;
  text-decoration: underline;
}

.text-mid:hover::after{
  text-decoration: underline;
}

.text-large{
  font-size: 140%;
  text-decoration: underline;
}

.text-large:hover{
  text-decoration: underline;
}

.nav-text-bold{
  font-family: 'Roboto', sans-serif;
}
<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/locations.css">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Locations | Location 1</title>
</head>

<body>
    <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
            data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false"
            aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <a href="../index.html">
            <img src="https://via.placeholder.com/100x40" alt="../index.html">
        </a>
        <ul class="navbar-nav ml-auto">
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle text-large nav-text-bold" href="#" id="dropdown01"
                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Locations</a>
                <div class="dropdown-menu text-mid" aria-labelledby="dropdown01">
                    <a class="dropdown-item nav-text-bold" href="locations/location1/index.html">Location 1</a>
                    <a class="dropdown-item nav-text-bold" href="#">Location 2</a>
                    <a class="dropdown-item nav-text-bold" href="#">Location 3</a>
                    <a class="dropdown-item nav-text-bold" href="#">Location 4</a>
                </div>
            </li>
            <li class="nav-item">
                <a class="nav-link text-large nav-text-bold" href="#">Media</a>
            </li>
            <li class="nav-item">
                <a class="nav-link text-large nav-text-bold" href="donate/index.html">Donate</a>
            </li>
            <li class="nav-item text-large">
                <a class="nav-link nav-text-bold" href="#">About</a>
            </li>
        </ul>
    </nav>

    <br>
    <br>

    <div class="container" id="content">
        <div class="row">
            <div class="col-12">
                <h2>Location 1</h2>
            </div>
            <div class="col-sm-6 col-xs-12 text-info">
                <p>1600 Pennsylvania Ave NW, Washington, DC 20500</p>
                <br>
                <p>Open Weekdays sometime to sometime</p>
                <br>
                <p>Tel:
                    <a href="tel:555-555-5555"><b>555-555-5555</b></a></p>
            </div>
            <div class="col-sm-6 col-xs-12 maps-embed">
                <iframe
                    src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3105.1501993708266!2d-77.03871848469284!3d38.89768045453255!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89b7b7bcdecbb1df%3A0x715969d86d0b76bf!2sThe%20White%20House!5e0!3m2!1sen!2sus!4v1574888816470!5m2!1sen!2sus"
                    width="400" height="300" frameborder="0" style="border:0;" allowfullscreen=""></iframe>
            </div>
        </div>
    </div>
    <br>
    <br>

    <script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

</body>

</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Conceal the sidebar menu by clicking anywhere outside of the menu bar or the designated button

I attempted to create a menu similar to the semantic UI, but so far I have only been able to click the menu button to open and close the menu. I am using a toggle class to display the sidebar, but I'm unsure if this approach is entirely correct: < ...

jQuery navigation is experiencing issues due to conflicting buttons

I am currently developing a web application that features two buttons in the header: Share and Options. When a button is clicked, its related content expands and collapses when clicked again. The issue arises when the user clicks on the share button and th ...

Tips for transferring the id from the url to a php function seamlessly without causing a page refresh

I have a div that includes a button (Book it). When the button is clicked, I want to append the id of the item I clicked on to the current URL. Then, use that id to display a popup box with the details of the clicked item without refreshing the page, as it ...

Ext.ux.TDGi.iconMgr is a cutting-edge plugin designed specifically for the latest version of

Has anyone successfully migrated the Ext.ux.TDGi.iconMgr plugin to ExtJS 4? (http://tdg-i.com/44/extuxtdgiiconmgr...-icons-and-css) ...

Discover the steps to dynamically alter the inclusion of the Bootstrap CSS file within an Angular project

I manage a multi-language website in both English (EN) and Arabic (AR). Currently, I am utilizing Bootstrap CSS from a CDN and adjusting the CDN link based on the selected language. index.html <!DOCTYPE html> <html lang="en"> <h ...

Interested in customizing the hover color of the header links in WordPress?

I'm currently working on customizing the hover color of the links in my WordPress header created with Elementor Page Builder. I tried several CSS solutions by inspecting elements and adding them to the custom CSS section in WordPress, but none seemed ...

Preserve unencoded HTML content as a string

Here is an example string: text = '&lt;div class="blue"&gt; &lt;p&gt;This is a sample text string' When I use <%= text.html_safe %> in my webpage, it displays correctly, but not when I try it in the console. If I attempt: ...

Event delegation will be ineffective when the target element is nested within another element

After receiving a recommendation from my colleagues on Stackoverflow (mplungjan, Michel), I implemented the event delegation pattern for a comment list. It has been working well and I am quite excited about this approach. However, I have encountered an iss ...

The issue with style.background not functioning in Internet Explorer is causing complications

I am currently developing a JavaScript game that involves flipping cards. However, I have encountered an issue with the style.background property. It seems to be functioning correctly in Chrome but not in Internet Explorer. Here is the problematic code sn ...

Creating a responsive design in HTML and CSS to organize images into two columns that stack

<html> <head> <style> .container { position: relative; width: 50%; } .image { opacity: 1; display: block; width: 100%; height: auto; transition: .5s ease; backface-visibility: hidden; } .middle { transition: .5s ea ...

Is it possible to include Helvetica or a similar font in my web application for shipping?

My web-app is Java/HTML based and hosted on the cloud. Users will access it using IE, Chrome or Mozilla. I would like to use Helvetica or a similar font, but they are not readily available on most systems (windows/IE/Chrome/Mozilla). Is there a way for me ...

Having trouble with playing the appended HTML5 Video?

Having trouble getting a video player to display after clicking a button. This is the code I use to add the video player in index.html: $("#videoContainer").append( "<video id=\"video-player\" width=\"100%\" height ...

Issue with loading Glyphicons from Bootstrap in Laravel Mix

After creating a new Laravel application and adding the auth template, I attempted to include a button with the following code: <button type="button" class="btn btn-default btn-lg"> <span class="glyphicon glyphicon-stop" aria-hidden="true"> ...

Adding items to Bootstrap dropdown in Django

Currently, I am working on a side project where I am using Django and Bootstrap to create a to-do list. However, I am encountering an issue with adding items to the dropdown list. My goal is to have a dropdown menu with a list of people's names, but w ...

Unable to bypass YouTube advertisement

I am currently experimenting with using nodejs puppeteer to test if I can bypass the ad on Youtube. Although this is just for testing purposes, I am facing some challenges with getting it to work as expected. I have implemented a while loop to search for ...

"(PHP)WordPress produces a dynamic menu that adapts to different screen sizes

I recently created a menu on my WordPress site [ and I'm facing an issue with making it display vertically in a responsive way. The code in header.php is as follows: <!-- header --> <header> <div class="overNavPanel"> ...

Generate an image of a "button" with dynamic hover text

I am trying to create a clickable image with dynamically changing text overlaid on it. I have the PHP code that retrieves the necessary information for the text, but I am struggling to create the button as I am new to this type of task. Here is an example ...

Tips for refreshing the default style of Material UI select

I'm having trouble customizing the default background color of the first menuItem in the select component. The class I need is not visible when inspecting the element, as the background color disappears upon inspection. Steps to reproduce: 1. Click ...

Creating a Dynamic Soundtrack: How to Embed an Audio

Success! I finally figured it out, with a little help from everyone. I've been diving into the world of Audio Playlists in HTML and attempted to follow a tutorial on the topic found here: https://www.youtube.com/watch?v=vtZCMTtP-0Y. However, I encoun ...

Ensuring that the second level unordered list is set to a height of 100% of the first unordered list, rather than the

I'm working with this menu http://codepen.io/alexandernst/pen/oxpGYQ (I wanted to include it here but the result viewer on SO is causing some display issues...) and I am trying to ensure that the second and third level ul elements are the same height ...