Showcase three elements next to each other on the same row (Photo Gallery, Description, and Contact Form)

I am attempting to showcase three divs in a single line while working on a Subtheme for the Drupal 8 Bootstrap Theme. These particular divs are fields nested within a view known as viewproducts.

The divs include:

  1. Juicebox Photo Gallery;
  2. Text: "Title" + "Reference Label:" & "Reference number" + "Description" + "Price Label" & "Price";
  3. Webform: "First and Last Name" + "Email" + "Phone" + "Message" + "Send Button"

The objective is to create product rows, with each row consisting of the described elements positioned in the following order on the screen:

LEFT: Juicebox Gallery          CENTER: Text group of elements          RIGHT: Webform
    

- Gallery: OK;

- Text group: How can I align all elements to center while maintaining the specified order?

- Webform: How do I center all elements while preserving the webform order without accessing HTML directly? I have attempted different styling approaches such as relative position, absolute, and others, but they haven't produced the desired layout.

Below are the class names for the specific elements:

  • Juicebox gallery: "viewimagefield"

  • Text Group:

    • Article Title: "viewtitlelabel" and "viewtitlefield"
    • Article Reference: "viewreflabel" and "viewrefrield"
    • Article Description: "viewdescriptionfield"
    • Article Price: "viewpricelabel" and "viewpricefield"

  • Webform class="viewform": - First and Last Name: "prodformname"

    • Email: "prodformemail"
    • Phone: "prodformphone"
    • Message: "prodformmessage"
    • Send: "prodformbutton"
.viewproducts ul {
      list-style-type:none;
      align-content: flex-start;
    }
    .viewproducts .view-content .views-row{
      float: left;
      height:50% !important;
      margin: ;
    }
    ...
    (CSS styles continue)
    ...
    

The current output shows the Gallery on the left, the Text centered but misaligned, and some elements placed behind the Gallery. The form appears below both sections with various alignment issues. It seems challenging to achieve a specific order in this layout. Refer to the screenshot for an idea of what's happening: enter image description here

Here is the fiddle link. Please note that the HTML structure should not be altered, as I am constrained to work within the Drupal framework without direct HTML manipulation.

Answer №1

To create a layout with equal width sections in the same row, consider using the Bootstrap grid system:

    <div class="row">
        <div class="col-4"> 
        //Left section 
        </div> 

        <div class="col-4">
        //Center section 
        </div> 

        <div class="col-4">
        //Right section 
        </div> 
    </div>

If you prefer not to use Bootstrap, you can also achieve a similar layout by applying float:left; to each div element through CSS.

For more information on the Bootstrap Grid System, check out their official documentation here.

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

Hover effect transition malfunctioning

I've been attempting to incorporate a hover image effect on my website. I included the script in the link below. However, I'm struggling to achieve a smooth fade transition and a 2-second delay on the hover image. Can someone please assist me wit ...

no visible text displayed within an input-label field

Currently, I have started working on a multi-step form that is designed to be very simple and clean. However, I am facing an issue where nothing is being displayed when I click on the next arrow. I am puzzled as to why it's not even displaying the te ...

The canvas div wrapper flexbox item is in need of scrollbars

I am looking to display a canvas that may be larger than the viewport size. The layout structure will include navigation on the left and controls on the right, with the canvas positioned in between them. When the canvas is too large for the screen, I wan ...

Using CSS to apply a gradient over an img element

Looking to add a gradient overlay to an <img> tag with the src attribute set to angular-item. Here's an example: <img src={{value.angitem.image}}> I attempted to create a CSS class: .pickgradient { background: -webkit-gradient(linear ...

Does the padding and margin of an element alter when the position is set to relative?

By utilizing relative positioning, an element can be moved in relation to its original position in normal flow. - Citation from the book "HTML&CSS: design and build websites" by John Duckett If an element has a relative position property, it opens up ...

Manipulating text alignment and positioning in CSS

Can someone help me achieve this CSS result? img1 This is what I have so far: img2 I'm struggling to center the elements and add a line in CSS. Any advice? I thought about using margin: auto, but I'm not sure if that's the best approach ...

Can you direct me to resources on the internet that provide information about support for 12 Bit color depth?

I am curious to know when the w3specs will support colors in 12 bits instead of the current 8-bit format used for webcolors like sRGB (#FFFFFF or rgba(255,0,0,100). I wonder if there will ever be a new standard called 12-Bit sRGB where colors can be defin ...

How can we use jQuery to extract an HTML element's external stylesheet and add it to its "style" attribute?

My goal is to extract all CSS references from an external stylesheet, such as <link rel="stylesheet" href="css/General.css">, and add them to the existing styling of each HTML element on my page (converting all CSS to inline). The reason for this re ...

Ways to showcase a list in 3 columns on larger screens and 1 column on smaller screens

When viewing on a computer, my list appears like this: However, when I switch to a phone, only the first column is visible and the list does not continue in a single column format. I am utilizing Bootstrap for my layout, and here is a snippet of my code: ...

Difficulty encountered in closing div by clicking the background with the help of jquery

I am facing a challenge with properly closing a div container and restoring it to its original state when I click outside of it. Despite trying various solutions from stackoverflow and extensive internet research, I have been unable to find or come up with ...

Tips for setting height within a flexbox layout?

Is there a way to specify the height of rows in a flex wrap container so that text containers appear square on both smaller and larger screens? I want the sizing to be dynamic, adjusting as the window is resized. Check out this example on CodeSandbox Loo ...

Tips for replacing default arrow icons with 'Previous' and 'Next' buttons in a Material-UI pagination element

I've been struggling to find a solution with my code provided below. Despite multiple attempts, the issue remains unresolved. import React from "react"; import { gridPageCountSelector, gridPageSelector, gridPageSizeSelector, useGridA ...

Utilize/Absolve/Add a Prefix to angular material scss styles

Issue I am facing a challenge with integrating angular material SCSS into my application. I want to ensure that these styles are isolated and scoped specifically for my application, as it will be embedded within a larger monolith. The goal is to prevent a ...

When utilizing jQuery to retrieve the height of position:absolute elements, the script is being executed twice, resulting in inaccurate values being returned on

The issue I'm encountering with detecting the height of absolutely positioned content is demonstrated in this JSFiddle. I am working on creating a tabbed panel where users can select a room type and then a sub-type. The sub-types (ul.sub-types) are s ...

The inline-block property can become unstable when dealing with a large number

When I create a parent container div with three child divs and set the display property to inline-block, everything looks great on jsfiddle CSS #container { border: 1px solid blue; padding: 2px; display: inline-block; } .child { width: ...

What are the steps to create a CSS 'shell' design?

How can I create an image displayed as a circle with border-radius:50%, along with some text on the same line that has a set width and background color? I want to achieve this without hard coding values. What is the best approach to do this? Check out the ...

AngularJS is used to vertically collapse three different div elements. This feature

I am facing an issue with the design of my page that contains three panels. Two of these panels have tables, and when viewing the page on a smaller display, it disrupts the layout. I am wondering if there is a way to add collapsible buttons to the panels s ...

The Carousel feature functions properly with 3 or more slides, but malfunctions when there are only 2 slides present

After implementing a minimal carousel, I discovered that it functions perfectly with 3 or more slides. However, as soon as I remove some slides, issues start to arise. Some of the problems I encountered include: The sliding animation is removed on ' ...

Design a custom cover page before printing using the window.print() method

When it comes to printing, I have a header and footer displayed on each page. However, I want the first page to be clean with just a picture or title, without the header and footer that appear on subsequent pages. I've attempted to use CSS like this ...

The typewriter effect is configured to appear as a separate layout,

<div className= "HomePage-typewriter"> I do{'\u00A0'} <Typewriter options={{ strings: [ '<span> this </span>', '<span> that </span>', '<span&g ...