Separating text into rows with CSS styling

My wordpress/woocommerce website has a plethora of product options. In the cart, these options are currently displayed as a continuous text, which can be challenging to read. I am wondering if it is possible to use CSS to structure these options into neat rows, making them more organized and easier to navigate.

I am looking for a convenient solution, preferably using CSS, but I am open to other suggestions as well.

Please add the following product to your cart LINK. The "Add to Cart" button is labeled as "LÄGG TILL I KUNDVAGN" in my language. Then proceed to the CART.

In the cart, under the title and next to the product image, you will see the type of option in regular text, followed by a colon and the chosen option in bold text. For example, the first two options might appear as: "Width: 5 (480 mm) Height: 5 (480 mm)".

However, I would like these options to be displayed in separate rows, like this:

Width: 5 (480 mm)

Height: 5 (480 mm)

And so on.

Is there an easy way to achieve this with CSS or any other method? Your help is greatly appreciated!

Answer №1

to have all the items stacked together, use

.variety{ 
 display: flex;
 flex-direction: column;
}

Answer №2

The solution to this problem involves utilizing the power of flexbox. Implement the following CSS code to effectively address the issue at hand:

.tm-cell {  /*Alternatively, you can modify your selector*/
  display: flex;
  align-items: center;
  justify-content: space-between;
}

Answer №3

When examining the HTML code, you will notice that the div encompassing the entries is defined as:

<div data-uniqid="58ede56aeca6c6.03775072" data-logic="" data-haslogic="" data-fblabelshow="" data-fbvalueshow="" class="cpf_hide_element tm-cell col-6 cpf-type-select prod-height-div">

The width of its class is initially set to 50%, but you can adjust it to 100% using this CSS snippet:

.tm-extra-product-options .col-6, 
.tm-extra-product-options .tm-cell.col-6, 
.tc-cell.tc-col-6, .tc-col-6 {
    width: 100% !important;
}

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

How to toggle the display of a div by its id using index in Javascript

Currently, I am encountering a problem with toggling the div containers. When I click on the video button, I want the other divs to close if they are already open. However, due to the toggling mechanism, if a div is closed and I click on the corresponding ...

What key element is not included in this code?

I've been trying to create an interactive green circle that switches between red and green when clicked. Despite checking and rechecking my code, it's still not functioning correctly. I must be making a beginner mistake somewhere. Can anyone poin ...

Conceal a single column on mobile devices using Bootstrap 4

Take a look at this code snippet: <div class="row"> <div class="col-lg-3"> <div class="ava-block"> </div> </div> <div class="col-lg-6 ...

Issues with ASP.net CSS not functioning properly in Internet Explorer, although it works fine in Firefox, Edge, and

Hello everyone, After spending several hours debugging and researching, I have hit a roadblock and can't identify the issue. As a less experienced coder, I am reaching out to seek your help. I am currently working on an ASP.NET C# page that was cre ...

"Eliminate specific time increments like days, hours, and minutes when the timer reaches zero in a jQuery countdown

Utilizing jQuery countdown, I am attempting to eliminate days/hours/minutes when the timer reaches 00 using the update callback function .on('update.countdown', function(event) {. It is almost working correctly. However, there is just one issue: ...

Can you include text within the border of a table?

Currently tackling my homework assignment which involves creating a virtual chessboard. Progress has been smooth thus far, as I've managed to write the code for it: I am now looking to incorporate Letters (A-H) and Numbers (1-8) around the board, rep ...

JavaScript problem with hovering action causing additional buttons to appear

Currently, I am developing a user interface where, upon hovering over an LI element, 2 buttons appear to provide additional functionality - "edit" and "remove". However, I am facing challenges with the mouse hit zones. The mouseover function works effect ...

Using HTML5 canvas to design a customizable measuring tool

I am trying to figure out how to create a ruler on the top and left side of my document, just like the one shown in the image. I've searched everywhere but haven't found anything useful. Can anyone please help me with this? ...

Learn how to prevent a button from being clicked until a different button is activated using jQuery

I'm currently working on implementing jQuery code to prevent users from clicking the registration button unless they have clicked on the survey button first, which triggers a modal window. Can anyone offer some assistance with this? The main requirem ...

Encountered an error 'Unexpected token ;' while attempting to include a PHP variable in a jQuery AJAX call

Trying to execute a PHP script that updates a deleted field in the database when you drag a specific text element to a droppable area. Currently, here is the droppable area code: <div class="dropbin" id="dropbin" > <span class="fa fa-trash-o ...

How can one get rid of a sudden strong beginning?

Recently, I delved into the world of CSS animation and encountered a frustrating issue. I've tried numerous methods and workarounds to achieve a smoothly looping animation without interruptions. Despite my efforts, I have not been able to replicate th ...

What is the proper way to include a forward slash at the end of my web addresses?

I need assistance adding a slash at the end of all my URLs. Currently, I am using a .htaccess file to remove the .php extension as shown below: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] Now, I would l ...

The Challenge of Styling Scrollbars with CSS

.body_c { scrollbar-face-color:#408bc4; scrollbar-shadow-color:#afefff; scrollbar-highlight-color:#afefff; scrollbar-3dlight-color:#000000; scrollbar-darkshadow-color:#006399; scrollbar-track-color:#bfd3e6; scrollbar-arrow-color:#FFFFFF; margin-top ...

Display information from a .js file onto an HTML webpage

I'm completely new to the world of server-side development and I'm attempting to navigate it on my own. Currently, I have a server written in JavaScript using Express and I'm trying to display some content on my HTML page that was sent from ...

Adjust the size of the logo as the user scrolls

Currently, I am implementing a JavaScript feature that allows my logo to shrink when the user scrolls down and grow when they scroll up. To achieve this effect, I am utilizing the jQuery functions addClass and removeClass. However, I have encountered som ...

Retrieve the value of the second checkbox depending on the selection made in the first checkbox within a .jqGrid

In my .jqGrid, there is a hidden checkbox column with values. The checkboxes are displayed on the UI using multiselect: true. Essentially, I have a set of <tr>s where one <td> is hidden but contains a value. I need to extract the value of the h ...

What is the best way to retrieve the ids of child divs that are directly beneath a single parent div?

If I have a structure like the one below, I am looking to access each individual div inside its parent div and print its id using a for loop. <div class=abc> <div id="parent"> <div id="one"> <div id=........</div> ...

Is there a way to automatically open an expand/collapse section when linking to it?

I am attempting to automatically open the bootstrap expand/collapse details when linking to them from another page. For instance, I want to link to a page similar to , which includes multiple expand/collapse sections. My goal is to link to a specific sect ...

Why isn't my background image appearing on the screen?

I'm experiencing an issue with my background image not displaying properly. I am currently using bootstrap 5 and have tried several solutions without success. How can I resolve this problem? html { background: url(https://via.placeholder.com/150 ...

What is the process for selecting a radio button using Selenium WebDriver?

I am trying to select the radio button in this HTML code, but I'm having trouble. Here is the snippet of my HTML: <div class="appendContent"> <div> id="contentContainer" class="grid_list_template"> <div id="routeMonitor ...