Customize the Placement of the Add to Cart Button in Woocommerce using CSS

How can I ensure that the “Add to Cart” button remains aligned properly on the shop page, even when the product names vary in length? I attempted to implement this CSS code, but it only seems to work when hovering over the button.

.woocommerce .products .product .button {
  font-size: 13px;
  /* padding:8px 26px; */
  margin-left: 10px;
  position: absolute !important;
  display: block;
  bottom: 30px;
  vertical-align: bottom !important;
}
.woocommerce a.added_to_cart {
  /* display: inline-block; */
  font-size: 12px;
  line-height: 18px;
  padding-top: 8px;
  position: absolute !important;
  display: block;
  bottom: 30px;
  vertical-align: bottom !important;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}

Answer №1

If the product name is lengthy, consider breaking it up or utilizing 'product name so long.....' for better display. Another option is to customize the archive.php template on your child theme.

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

Improving efficiency of basic image carousel in Angular 8

In my Angular 8 app, I am developing a basic carousel without relying on external libraries like jQuery or NgB. Instead, I opted to use pure JS for the task. However, the code seems quite cumbersome and I believe there must be a more efficient way to achie ...

Switching from a horizontal orientation to a vertical layout for navigation

My current horizontal navigation bar needs to be transformed into a vertical left layout. Here is the HTML code: <div ng-controller="PortalController"> <header> <h1>E_Zuite</h1> <nav role='navigation&apo ...

Adding an id to a ul tag using JavaScript

I am trying to dynamically add an ID called "myMenu" using JavaScript to a ul element for a search filter. Unfortunately, I am unable to directly access the ul tag to change it, so I need to do it via JavaScript. As I am new to JavaScript, I am looking t ...

adjustable canvas dimensions determined by chosen images

I would like to create a canvas image based on the selected image <canvas id="canvas" ></canvas> <input type="file" id="file-input"> Using JavaScript: $(function() { $('#file-input').change(function(e) { var file ...

"Implementing a function to automatically input a selected value from a dropdown menu into a text field

I'm facing an issue and need some help. I have a form with one select field and one text field. What I want is for the text field to display a value corresponding to the option selected in the select field. For example, if I choose "B" from the select ...

How do I change the class of an element using $this?

Please review the code below: $(".nwe-cl-icontext").click(function () { $(this).parent().toggleClass("nwe-active"); }) .nwe-cl-c.nwe-active { background: red; } .nwe-cl-c { background: green; } <scrip ...

CSS YUI compressor for efficient file size optimization

Seeking guidance on how to compress all CSS into a single line. Currently using the bwp-minify WordPress plugin, but looking to increase compression levels by modifying the YUICompressor.php file. Attempted adjusting the line-break parameter to 0 and 1000 ...

The sizing of Bootstrap Inline dropdown menus is not accurate

I want to create two dropdown menus using Bootstrap v3 that are displayed side by side with a specific width and utilizing the grid system. However, I am facing an issue where the width remains the same. Here is an example of what I mean: .menuList > ...

Tips for displaying sorting order when the column width is narrower than the caption in free jqgrid

Sorting columns in jqgrid can be done by clicking on the column header, with the ability to set a default sort order upon loading. Icons for sorting are specified using: $grid.jqGrid({ viewsortcols: [false,'vertical',true], The sort icon an ...

Unable to showcase particular array content in PHP and Wordpress

Although I have made progress with PHP, I am still in the learning process and require some basic assistance. I am interested in displaying only the value of 'mini-description' in the following array: Array ( [0] => Array ( [name] => mini ...

Fixed Row Feature in Visual Composer

Currently, as I work on a website in Wordpress utilizing the Visual Composer page builder, I have encountered a dilemma. I am attempting to ensure a row remains sticky at the top of the page. In an effort to achieve this, I have inserted the following CSS ...

What are the steps for printing a webpage in landscape orientation using Firefox and IE11?

@page { size: 11in 8.5in; } This code snippet did not achieve the desired result in Internet Explorer or Firefox. The transform: rotate(270deg); property only worked for the first page. ...

Is there a way to position the text within an email body at the center using SendGrid?

I've been working on creating an email newsletter template using SendGrid, and I've run into a formatting issue where the content doesn't align properly in the email body. The image below shows how it's appearing incorrectly. Does anyon ...

Ways to adjust the select element to match the width of its current option

As I work on building a form, I'm looking for a way to make the select element adjust its width based on the length of its current option. Essentially, I want the select element to expand or contract depending on the width of its longest option. I&ap ...

The height of the image remains constant when its width is decreased, causing it not to resize proportionally

I am facing an issue with displaying images in a div of various resolutions. When I have a wide image with low height, such as 730x90, it does not show properly on mobile devices. The width shrinks but the height remains the same. Below is the code snipp ...

Tips for sending AJAX forms with only certain fields provided

I have a form that allows users to update their account information. I have implemented ajax requests to save changes without refreshing the page. However, I only want to submit certain fields from the form as some are disabled. The code snippet below is w ...

Struggling to target specific elements in CSS that are dynamically generated through JavaScript

After using JavaScript to generate some divs, I ended up with the following code: const container = document.querySelector('#container'); for(let i = 1; i < 17; i++) { var row = document.createElement('div'); row.id = 'r ...

Is there a way to dynamically count the length of an element or class in realtime using JavaScript?

If there are currently 5 divs with the class name "item" and a new unknown number of divs with the same class name "item" are dynamically added in real time, I want my result to display the total number of divs present at that moment (i.e., 5 + n). Note: ...

What is the best way to insert margin guidelines within a DIV being utilized as a WYSIWYG editor?

My latest project involves a design editor created using HTML and jQuery, allowing users to add text boxes, images, and more to build up unique designs. The canvas is represented by a bordered div where users can add elements by clicking on buttons that cr ...

Determine the Sidebar Height within a CSS Container

I've been experimenting with a simple template to create a basic website layout featuring a header, footer, and a right-hand sidebar. However, I'm facing difficulties in setting the right-hand bar to occupy 100% of the page, even after ensuring ...