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

Calculate the total price using Jquery once selections have been made

I am looking to create a dynamic pricing feature where clicking on a checkbox will update the total price. The prices are calculated per day, so if days are added, the total should reflect that accordingly. Check out our demo here: http://jsfiddle.net/XqU ...

Which behaviors that are typically exhibited by browsers will be stopped by calling `event.preventDefault()`?

While I grasp that using event.preventDefault() stops default actions triggered by events in the browser, I find this explanation too general. For instance, what exactly are these default event behaviors in the browser? It's common to see developers u ...

When encountering a 404 redirect, CSS and JS files may fail to display

I created a unique error message using .htaccess, incorporating CSS and JS in separate folders. Although it functions properly when accessed directly, integrating these resources into the 404 Error message results in only the HTML text being displayed with ...

Efficiently processing multiple Ajax requests with a single callback function

I am currently facing a situation where I need to make multiple AJAX requests and only proceed if all of them are successful. The typical usage of $.when($.ajax(), [...]).then(function(results){},[...]); doesn't quite fit my needs because the number o ...

Exploring the concept of polymorphism in ASP.NET using FormView and DetailsView

In the process of developing an ASP.NET Master Page aimed at streamlining master/detail editing tasks, various functionalities such as ValidationSummary, error handling, and popup detail view using jQuery-ui dialog were incorporated. The concept involved i ...

How can I create a CSS animation that fades in text blocks when hovering over an image?

I have been trying to implement CSS3 transitions to create a hover effect where the text and background color fade in when hovering over an image. Despite my attempts with various selectors and transition types, I can't seem to achieve the desired res ...

Troubleshooting Problems with jQuery Cloning

Could someone take a look at this and point out what's wrong? I can't seem to figure it out: function retrieveStates(){ var stateData; $.getJSON("fetchStateData.php", function(data) { stateData = data; var lastGroup = ""; $("#group ...

Divide information in the chart

<table id="tab"> <tr><td class="sub">mmmmm</td><td class="sub">jjjjj</td></tr> <tr><td class="sub">lllll</td><td class="sub">wwwww&l ...

Performing an AJAX Post request with Jquery in a Ruby on Rails web

Using a straightforward controller setup: def new @product = Product.new respond_to do |format| format.html #new.html.erb format.json { render json: @product} end end def create @product = Product.new(params[:product]) ...

Tips for locating an element within pre-processed HTML content

Is there a way to modify this code snippet to target the 'price' element within each 'info_block' instead of displaying the entire 'info_block' content? My ultimate goal is to locate the price within every 'info_block&apo ...

Delightful Bootstrap Tabs with Dynamic Content via Ajax

My website has a lot of tabs designed with Bootstrap. I wanted to make them responsive, so I tried using a plugin called Bootstrap Tabcollapse from https://github.com/flatlogic/bootstrap-tabcollapse (you can see a demo here: http://tabcollapse.okendoken.co ...

The text box remains disabled even after clearing a correlated text box with Selenium WebDriver

My webpage has two text boxes: Name input box: <input type="text" onblur="matchUserName(true)" onkeyup="clearOther('txtUserName','txtUserID')" onkeydown="Search_OnKeyDown(event,this)" style="width: 250px; background-color: rgb(255, ...

Struggling to locate the elusive operator in SQL using OLEDB with VB.NET

My query is causing a syntax error in query expression when I try to run it. This code was working fine with sqlclient and an sql server .mdf file, but now that I am reading from an MS Access .mdb file, it is giving me the error of a missing operator. Di ...

Activate the toggle menu

Hi there! I'm currently working on a menu and I want the clicked item to become active, switching the active state to another item when clicked. However, my current implementation is not working as expected. Any assistance would be greatly appreciated ...

Difficulty in managing vertical overflow in a dynamically sized table using Bootstrap

I am facing an issue with the table-responsive class that is causing a scroll on the y-axis even though it is not specified in the CSS. Shown below is a screenshot of the problem, and I have also managed to replicate the bug: <div id="app"> <d ...

Building a Table Using HTML and CSS

I'm currently tackling this school assignment and have hit a roadblock with two issues. The HTML Validation error I'm encountering is regarding a table row that is 5 columns wide, exceeding the established count by the first row (4). From line 7 ...

The SubMenu icon in Android disappears when creating a menu dynamically

I'm currently working on creating a dynamic menu list, and I've managed to create the menu options successfully. However, every time I run my code, the icon for the main item disappears. Below is a snippet of my code: private static final int SU ...

Ways to showcase your style using Bootstrap

Can you help me figure out how to align this sidebar properly? I tried using the d-flex property but it doesn't seem to be working for me. The sidebar should be on the left side and the two containers should be centered. For a clearer explanation, pl ...

Using PHP regular expressions to find the final occurrence trailing after the last match in HTML

Looking to analyze a webpage (where the same product price is compared on different stores - each store has a block with its logo, price...) I want to separate each store into a different array element using preg_match_all I am trying to skip the advert ...

Actions for jQuery's mouseenter and mouseleave events

I've implemented a jQuery script that controls the visibility of elements based on mouse events: $("#divid").mouseenter(function() { $('#divid').show(1000); }).mouseleave(function() { $('#divid').hide(1000); }); $("#hldiv" ...