Ensure that a DIV element stretches beyond the limits of its container

I am having an issue with a div that should overlap everything else as it functions as a menu. Despite trying various positioning tricks, the desired effect is not achieved. The div is only shown when hovering over a certain element.

Here is the structure of the HTML:

<ul class="product-prices-dropdown">
            <li>
                <a href="http://melopienso.com/testingtwo/product/forza10-medium-maintenance-de-ciervo-y-patatas/">Ver Precios</a>

                <div class="price-list">            
                    <ul class="prod-dd-list">
                                                        <li>
                                <div class="dd-shop-img-block">
                                    Retailer1                                   </div>

                                <div class="dd-price-block">
                                    <p class="dd-price-text">8,00€</p>
                                    <p class="dd-tax-text">+tax &amp; shipping</p>
                                </div>

                                <a href="http://www.retailer1.com" target="_blank" class="btn-dd-cart">Hello</a>
                            </li>
                                                        <li>
                                <div class="dd-shop-img-block">
                                    Retailer 2                                  </div>

                                <div class="dd-price-block">
                                    <p class="dd-price-text">11,00€</p>
                                    <p class="dd-tax-text">+tax &amp; shipping</p>
                                </div>

                                <a href="http://www.retailer2.com" target="_blank" class="btn-dd-cart">Hello</a>
                            </li>
                                                </ul>
                </div>
            </li>
        </ul>

Below is the corresponding SCSS code:

ul.products li.product { clear: both !important; display: block !important; margin-bottom: 50px !important; width: 100% !important;

a {

    h3 {
        display: block !important;
        font-weight: 400 !important;

        &:hover {
            color: $corporate-color !important;
        }
    }
}

.gk-columns > div.product-image {
        display: inline-block !important;
        /*float: left !important;*/
        height: 32% !important;
        width: 32% !important;
}

.gk-columns > div.product-attributes {
    padding-left: 1%;
    width: 35% !important;

    ul.list-product-attributes {
        display: inline-block;
        /*float: right;*/


        p.list-product-attributes-label {
            color: $black;
            margin-bottom: 0 !important;
            margin-top: 0 !important;
        }

        p.list-product-attributes-value {
            color: $grey-dark;
            font-size: 12px !important;
            margin-bottom: 0 !important;
            margin-top: -5px !important;
        }
    }
}

.gk-columns > div.product-prices {
    display: inline-block;
    /*float: right;*/
    position: relative;
    width: 28% !important;

    .product-prices-dropdown{
        li {
            color: #FFF;

            a {
                background-color: $corporate-color;
                border: 1px solid $corporate-color;
                color: #FFF !important;
                display: inline-block;
                height: 30px;
                padding: 0 25px !important;
                position: relative;
                text-transform: uppercase;
            }

            div.price-list {
                background-color: $corporate-color;
                display: none;
                height: 200px;
                right: 54px;
                margin-top: -1px;
                padding: 5px 10px;
                position: absolute !important;
                width: 500px;

                ul.prod-dd-list {
                    height: 200px !important;


                    li {
                    display: block;
                    float: left !important;
                    height: 50px !important;
                    position: relative;
                    width: 100% !important;


                        div, a {
                            /*display: inline-block;*/
                            float: left;
                            /*position: relative !important;*/
                        }
                    }
                }
            }

            &:hover .price-list {
                display: block;
                /*position: absolute;*/
            }

            &:hover a {
                background-color: $corporate-color;
                color: #FFF;
            }
        }
    }
}

}

The issue can be observed on the following URL where the lower part of the overlapping div does not extend beyond its parent container: (go to the last 3 products and hover "VER PRECIOS"). It won't display the lower part of the div that surpasses the whole product container.

Any insights on what might be causing this?

Thank you for your help!

Answer №1

To ensure that your menu is displayed correctly, add overflow:visible; to the container holding it. You can also utilize z-index: to control the positioning of elements in relation to each other (higher numbers appear above lower numbers).

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

Animate the entrance of mobile content as it slides into view while scrolling

I am currently working on a WordPress theme and facing an issue: When I click the hamburger menu without scrolling down the page, the mobile menu slides in smoothly. However, if I scroll down the page, the mobile menu fails to slide into view (I have to s ...

Video is not visible in safari browser initially, but becomes visible only after scrolling for a little while

Having issues with a video not displaying correctly in Safari? The problem is that the video only becomes visible after scrolling the browser window. Want to see an example of this issue in action? Click here and select the red bag. Check out the code sni ...

What could be causing my CSS code to not function properly within Vue.js?

Having trouble with css in VueJs. I can't seem to figure out what I'm doing wrong. Generally, my scoped style css works fine in vuejs, I can target ids and classes without any issues. The problem arises when trying to change the internal css va ...

Trigger the onClick event of an element only if it was not clicked on specific child elements

<div onClick={()=>do_stuff()}> <div classname="div-1"></div> <div classname="div-2"></div> <div classname="div-3"></div> <div classname="div-4"></div> ...

The website is missing the display of Google Maps

The Google map is not displaying on my website page that uses PHP. I need assistance with this issue. Below is the webpage URL and the source code: <section class="meteor-google-map fullwidth block" style="height: 450px; border: solid transparent; bo ...

PNG file unable to display in Google Chrome

I created an image using paint.net and saved it as a .png file. However, when I try to display the image on my website, only the borders show up without any image content. Here is the code I used: HTML <a href="home.php"><img id="logo" src="../i ...

Issue with CSS: Hover effect causing unexpected additional white space

My main goal is to implement a hover effect that covers an entire section, but I'm facing some challenges. When I hover over my products, it doesn't behave as expected and adds extra white space below while not covering the section properly. Thi ...

"Implementing a full page refresh when interacting with a map using

Here is an example of how I display a map on the entire page: <div id="map_canvas"> </div> UPDATE 2: I have successfully displayed a menu on the map, but there is a problem. When I click on the button, the menu appears briefly and then disapp ...

The behavior of Elementor lightbox buttons upon being clicked

When using Android, I've noticed that the lightbox briefly displays a semitransparent cyan bar on the left and right buttons when they are pressed. Is there a way to control or prevent this behavior? Any suggestions would be appreciated! Thanks in adv ...

How can we prevent the text from shifting when the border width is adjusted

I've run into an irritating issue. My left menu text keeps shifting when I expand the border using jQuery. I've tried various solutions to prevent the text from moving, but nothing seems to work. Any suggestions? Could it be a CSS problem with t ...

Assigning a class to a header upon loading the page from various sections at random

After scrolling, I used JavaScript to add a class to <header>. Here is the code snippet: $(window).scroll(function(){ var top = $(window).scrollTop(); if(top>=1){ $("header").addClass('bg-header'); } else ...

Menu Tabs with Rounded Edges

Seeking help to round the corners of a tabbed dynamic menu using Drupal and the dynamic-persistent-menu module. The code provided below is almost perfect, with 99% accuracy. View the current state of the menu here: . Can anyone assist in achieving the rema ...

The drop-down menu keeps flickering instead of remaining open when clicked

I am facing an issue with a dropdown menu in my webpage. The menu is initially hidden, but should become visible when the list element containing it is clicked. I have written JavaScript code to add a class that changes the visibility property to visible u ...

Utilizing Bootstrap CSS within Vue's scope

I'm attempting to integrate Bootstrap into a Vue component while ensuring that all CSS is scoped. My initial approach was as follows: <style scoped> @import "~bootstrap/dist/css/bootstrap.css"; @import "~bootstrap-vue/dist/bootstrap-vue.css"; & ...

Using the arrow keys to navigate through a list of items without using jQuery

Exploring ways to develop a basic autocomplete feature without relying on third-party dependencies has been my recent project. So far, I have managed to populate a results list using an ajax call and complete fields with mouse onclick events for each optio ...

Why does the <div> element still have an offset even though its width and height are set to 100px and padding, margin, and border are set to 0px?

After styling my div element with specific CSS rules, I'm encountering an issue. The div has a set width and height of 100px along with padding, border, and margin all set to 0px. However, the elements are not being offset from the edges of the browse ...

What methods can be employed to maintain a consistent width for a multi-line span that aligns with the content?

Inside a div, I have 2 spans. When the content of the first span is short enough to fit on one line, the span's width matches the text content and positions the second span next to it. If the content of the first span is long and causes it to wrap, t ...

Enhance Your Images with Hovering Icons

Is there a way to display an icon checkmark over the main image when a user hovers over it? The icon should appear in the top right corner of the image. <div> <img class="result-image" src="{{$property->photo}}"> <! ...

What is the best way to automatically create a line break once the User Input reaches the end of a Textbox?

I've been searching for a solution to this question without any luck. Here is the tag I'm working with: <input type="text" id="userText" class="userTextBox"> And here is my CSS: .userTextBox { /* Add marg ...

Opacity transition in CSS does not function properly on a sibling selector when hovering over an element

I have created a responsive menu where the list items after the 4th element are set to display:none; opacity:0 on mobile devices. The 4th element is an icon and when you hover over it, the hidden menu items appear as a block list below using li:nth-child( ...