Include new material in the upper-right corner of each row

Struggling with various styling techniques like pull-right, float, and row-fluid, I have come here to seek help:

My goal is simple - I want a Map to be displayed on the right side of a set of rows.

Currently, it looks like this:

Although close to what I desire, the name row and subsequent rows should be stacked vertically below each other.

This is how my HTML appears:

<div class="panel-body">
    <div class="row-fluid">
        <div class="col-lg-10 pull-right">
            <google-map id="my-map" bounds="map.bounds" events="map.events"
                center="map.center" zoom="map.zoom" draggable="true"
                control="map.control"> <marker ng-if="positionMarker"
                coords="positionMarker" icon="positionMarker.icon"> </marker> </google-map>
        </div>
        <div class="col-lg-4">
            <div class="input-group">
                <span class="input-group-addon">Number</span> <input type="number"
                    class="form-control" placeholder="Nr">
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-6">
            <div class="input-group">
                <span class="input-group-addon">Name</span> <input type="text"
                    class="form-control" placeholder="Name">
            </div>
        </div>
    </div>
</div>

I believe this is a common issue, but I haven't been able to locate a suitable example.

Any other attempts result in the name appearing below the number or shifting beneath the map.

Is there a way to prevent the map from occupying vertical space in the Bootstrap grid system?

Answer №1

For optimal layout, consider using a 2-column design:

  • The left column can be designated for your inputs
  • The right column can be utilized for displaying your Google Map

Additionally, ensure that you nest your .input-group within a .form-group to inherit the padding and margins provided by Bootstrap's default styles.

Below is a functional example (click on Full page for a clearer perspective):

body {
  padding-top: 25px;
}
.map {
  width: 100%;
  height: 150px; 
  background: tomato;
}
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container">
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">Panel heading</h3>
  </div>
  <div class="panel-body">
    <div class="row">
      <div class="col-xs-6">
        <form role="form">
          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon">Number</span> <input type="number"
              class="form-control" placeholder="Nr">
            </div>
          </div>
          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon">Name</span> <input type="text"
              class="form-control" placeholder="Name">
            </div>
          </div>
        </form>
      </div>
      <div class="col-xs-6">
        <div class="map"></div>
      </div>
    </div>
  </div>
</div>
</div>

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

Issue with Smooth Div Scroll on Chrome

I'm currently utilizing a plugin called Smooth Div Scroll, which can be found at Despite the automatic scrolling functionality working perfectly on Firefox, IE, and Safari, I'm encountering an issue with it not initiating when the page loads in ...

Tips for repairing buttons in the CSS container

The buttons in the CSS search-box are not staying fixed as intended. They should be within the search box, but instead, they are protruding out of the panel. I attempted to utilize z-index, but it did not produce the desired outcome. https://i.sstatic.n ...

Monitoring user logins based on user identification

How can I effectively monitor the activity of users who have logged into a web application that is managed by an external company? Despite my extensive research efforts, as a non-technical individual, I am struggling to understand how to utilize Google Ana ...

Responsive Div that Resizes Proportionally within Parent Container

Having a div element that adjusts its height based on width to maintain aspect ratio, I aim to place this div within another while maximizing available space vertically and horizontally without any cropping. It seems that object-fit: contain, typically use ...

Create a grid or flex layout with Bootstrap 4 that features a sticky first row and column

Does anyone have any suggestions on how to make the attached grid/table layout responsive using Bootstrap 4's flex/grid system? The layout should include a sticky first row and column for navigation items. I attempted using w- & h- classes, but it do ...

What is the best way to use CSS to evenly lay out a group of dynamically generated buttons?

My Vue-generated buttons need to be evenly laid out on the bottom of the page, with equal space on the left and right. The mdui button style I am using has fixed width and height, so I have to decide between a single row for fewer buttons (less than three ...

Is it possible to alter the name of a slot before displaying the element in the shadowDOM, depending on the slot utilized in the DOM?

In my project, I am working on implementing different features for both desktop and mobile devices. Some of these features can be replaced by slots. My goal is to have a slot that can be either replaced by a desktop slot called poster-foreground, or a mobi ...

Separate the paragraph within an HTML string and eliminate any paragraph that is empty

I need help splitting a string of HTML into an array list, with the condition that the paragraphs should not be empty. Each paragraph should contain some normal text, and if it only contains HTML text without any normal text like: <htmltag>&nbsp; ...

Adjusting the Direction of Flex Components

As someone who is new to css and html design, I recently started using flex in my bootstrap designs. My goal was to have the components sorted from left to right direction, similar to how it's done on this site. Now, I am looking to shrink the slider ...

How can an object be utilized within the image tag's src attribute?

Is it possible to use an object in the img src attribute? // HTML <img src= "item.img" ...

Issue with spacing when assigning a JavaScript array variable to a value within input tags during a loop

Having some trouble with JavaScript code where the value is not passing in its entirety if there are spaces between the words. How can I make sure the full string or array object gets passed into the input tag's value? This is how I am trying to assi ...

Guide on how to align the bootstrap popover's arrow tip with a text field using CSS and jQuery

I have tried multiple solutions from various questions on Stack Overflow, but I am still struggling to position the arrow tip of the bootstrap popover correctly. html: <input type = "text" id="account_create"/> js: $('.popov ...

The random quote generator or current tweet quote feature is malfunctioning

I am having trouble with a jQuery on click function that is not working to tweet the current quote. I am working on building a random quote machine and tweeting the current quote is essential. Despite successfully implementing the JSON API, I cannot seem t ...

What might be the reason behind the selection value not changing in the dropdown menu?

I have two buttons, one for adding an employee and one for editing. Submit Record $("#addNewEntry").click(function(){ departmentName = $("#selectEmployeeDepartment option:selected").text(); locate = $("#selectLocation o ...

PHP and jQuery to create an autocomplete text input feature

I've been working on implementing an auto suggest text box using PHP and jQuery, but it seems like the jQuery code I found online is already deprecated. I'm not sure if my code is incorrect or if the issue lies with the jQuery itself. Can anyone ...

Stop the context menu from popping up when the element is right-clicked

Is there a way to create a custom right-click interaction for an element on my website, <div class="myElement"></div>? I want to avoid the default context menu from popping up when the user right-clicks on this element in order to enhance the u ...

Combining Images and Navigation in Next.js using Tailwind CSS

I am facing an issue where the image from a particular section overlaps with the Navbar dropdown on mobile devices. Adding z-50 to the navbar did not solve the problem as expected. What I want is for the image to remain below the dropdown menu when it is ...

Is it possible to have a hover box with no spacing in between?

I am currently designing a navigation bar and I want to implement a feature where hovering over each link will display the box/background color without any space in between of Home, About Us, etc. For reference, you can check out this example here: http:/ ...

Extracting null data from web scraping using Python and Beautiful Soup

I'm currently facing challenges with extracting the correct values from a website that provides prices for Silver, Gold, Palladium, and Platinum. You can find the website here. Below is the HTML structure of the website: <div id="header-tab ...

The back-to-top button guides users back to their last visited page

I'm excited to explore AngularJS and I want to add two "return to top" buttons on different pages. Here's what I have so far: Page 1: <h1 id = "top"> .......... <a href="#top" target = "_self">Return to Top</a> Page ...