Implementing a button row and content alignment next to an image using Bootstrap or CSS

Ensure that the product detail page features a row with labels and buttons, positioned to the right of the image within Bootstrap columns.

I have utilized Bootstrap 3 for this page layout. However, upon implementation, I encountered an issue whereby the button row appeared at the bottom and the table started below it.

<div class="maincontent">

<!-- Image on left side -->

    <div class="details-gallery hidden-xs">
        <a class="bigimg fbox">
            <img alt="" id="detail-mainimage" />
        </a>
    </div>

    <div class='inline-block'>

<!-- Row containing labels and buttons -->
<form>
<label for="spinner">
                quantity
            </label>
            <input id="spinner" class='amount '/>
             <label for='total_eur'>Sum</label>
            <span class='maincontent-paymentsum' id="total_eur"></span>
            <input type="submit" value="Add to cart" class="btn btn-success" />
    <input type="button" class="btn btn-primary " onclick="javascript: history.back(1)"
           value='Back' />
</form>
    </div>
   ...
   <!-- Table intended to be displayed to the right of the image -->
    <table class="table table-hover table-condensed table-responsive inline-block">

How can I resolve this issue so that the content properly aligns to the right of the image?

What steps should I take to position the button row and table alongside the image, similar to the layout showcased in the initial image in this question? This pertains to a Mono ASP.NET MVC3 application.

Answer №1

To improve your layout, consider removing the .inline-block class and adding float:left to the details-gallery hidden-xs class instead. You can then wrap the entire right side of the layout (including div.inline-block, table.table-responsive, and div.details-productdescription) in a container like div.product-info-wrapper and also apply float:left to it. Additionally, you may need to use width: calc(100% - 270px); on this element for proper spacing.

If you need further clarification, feel free to ask.

Answer №2

Set the CSS property "float:left" on the div containing the image

<div style="float:left" class="details-gallery hidden-xs">
    <a class="bigimg fbox">
        <img alt="" id="detail-mainimage" />
    </a>
</div>

Also, decrease the width of the table:

<table style="width:350px" class="table table-hover table-condensed table-responsive inline-block">

That should take care of it

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

The modal remains visible

Has anyone encountered a problem with hiding a Bootstrap modal based on form validation in JavaScript? I'm facing an issue where the submit function is not executed when I click the button. I've attempted using onsubmit=validateForm(), but it doe ...

Tips for integrating a unique font into your PhoneGap project

I've been attempting to incorporate a custom font into my PhoneGap application, trying out two different methods I came across online. Unfortunately, neither of them seem to be effective when using PhoneGap 3 and Xcode 5. First method involves using ...

Populate an HTML5 arc with an image - Leveraging the power of HTML5 Canvas

I'm working with an HTML5 Canvas (JSFiddle) that currently displays circles created using the following function: function createball(x,y,r,color){ context.beginPath(); context.arc(x,y,r,0,Math.PI*2,true); context.fillStyle = color; c ...

Ensure the presence of an editable column within a table using a jQuery function

Within the table, the first column is editable. Upon making a change to it, I want an alert to appear indicating that a change has occurred. The check function is being called after a delay of 5000ms. Embedding Code Snippet for Reference I suspect there ...

Tips on transferring a Rails variable to Ajax

Struggling to integrate a progress bar (Javascript) into my Ruby on Rails application, I am facing difficulties in passing values from the controller to JS for updating the bar. In my initial attempt, I used a basic global variable ($count), but it remain ...

The unusual loading of images in TableSorter

While debugging my frontend on Chrome, I noticed a strange behavior with the TableSorter plugin when applied to a table on the page. It seems to be trying to load string/binary data from this URL (and generating at least 10 requests simultaneously): Reque ...

"What are some best practices for utilizing the $.ajax method in conjunction with the

Utilizing AJAX, I send data to my Apache/PHP webserver (XAMPP). The shorthand syntax $.post works perfectly fine for me. Here is the code snippet: return $.post('http://localhost:8099/login.php', { loginDataInput : loginDataInput }).th ...

Guide to executing a batch file using electron

I've been struggling all morning to find a solution. I've gone through several tutorials, but I still can't wrap my head around how this should work. In my Electron app, there is a button that, when clicked, should execute a batch file (hpm ...

Guide on adjusting the darkness of a MaterialUI Avatar component image and adding text to it

I'm currently working with the Avatar component from Material UI along with Tailwind CSS. I found that by simply adding the image URL to the src, it displays the avatar successfully. <Avatar alt="Cindy Baker" src="https://mui.com/sta ...

What is the best way to ensure that a component remains the highest layer on a react-leaflet map?

I am encountering an issue where the table on my page only shows for a brief second when I refresh the page, and then it disappears. The Map Component being used is a react-leaflet map. I would like to have a component always displayed on top of the map wi ...

Attempting to incorporate a drop-down menu option in conjunction with JQuery PHP search functionality

I'm currently using the following code for a search function that fetches data from fetch_data.php and it's working well. However, I want to add an additional filter option to the search page, such as Country or City. I've tried several meth ...

Scroll bar malfunction in Highcharts

I am struggling to get the scroll bar working so that all categories can be displayed. I have tried different approaches but haven't been able to figure out where I'm going wrong. See the code in action here: http://jsfiddle.net/manraj/7racxxu0/ ...

The Angular Ivy strictTemplates error message states that the type 'Event' cannot be assigned to the type 'InputEvent' parameter

I'm feeling lost trying to figure out what's wrong with this code snippet: <input #quantity type="number" matInput formControlName="quantity" (input)="onQuantity($event, i)" placeholder="Quantity"/> onQuantity(event: InputEvent, i: number ...

Combining Sass and SCSS in webpack: A step-by-step guide

Just curious about something. I have some libraries I'm interested in using (for example, font-awesome) that use scss, but I personally prefer working with sass. How can I set up my project with webpack to accommodate this? Here's my current s ...

Initiating an Ajax POST request when the onblur() event is triggered

Having an issue with Ajax. I'm trying to submit a changed value from an input field on the onblur() event, but there's a flicker that's bothering me. When I enter a new value and click away, the old value briefly flashes back before changi ...

Employing the "div" element to target in CSS styling

I'm dealing with a document structure that is consistent across multiple pages. HTML: <ul> <li> <div> <img src="" /> </div> </li> </ul> Presently, there is a border aroun ...

I'm having trouble getting the height of my div element to render in percentage (%) in the CSS. Can anyone assist me with this issue?

When I try to set the "height" CSS property in percentage (%) for a div element, the HTML doesn't render anything. However, if I set the "height" CSS property using length values such as px or cm, it works perfectly fine. Can anyone provide assistance ...

What is the best way to trigger a jQuery function when an option is selected from a Select2 dropdown menu?

I have implemented Select2 for custom dropdown styling. The options are structured like this: <option value="001,100">Option 001</option> <option value="002,200">Option 002</option> <option value="003,300">Option 003</opti ...

Issue with combining overflow-x, Firefox, and JavaScript

In Firefox, an issue arises that does not occur in other browsers. To see the problem in action, please visit this example page: -removed- Try selecting a page other than the home page. The window will scroll to your selection. You can then scroll down u ...

Finding the current HTML page URL in Ionic 2: A step-by-step guide

Can the URL of the current HTML page be obtained and then converted to PDF using the cordova-pdf-generator package? ...