When placed in an absolute position, Overflow seems to be malfunctioning

Within a div that is positioned relatively, there is another div positioned absolutely. Despite setting overflow:hidden and border-radius on the main div, the inner div's edges are not contained within the main one, indicating that the overflow property is not functioning as expected.

For a live preview and full code sample, click here: http://jsfiddle.net/sYv78

<div class="gridElement">
    <img alt="image" src=
    "https://pbs.twimg.com/profile_images/441318694942031872/I2cc6yMB.jpeg">

    <div class="animate">
        <p>Brief Description</p>
    </div><a href=""></a>
</div>

.frames img, .frame {
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
}
/*Grid Systems*/
 .grids {
    -webkit-column-count: 3;
    -moz-column-count: 3;
    column-count: 3;
    -webkit-column-gap: 10px;
    -moz-column-gap: 10px;
    column-gap: 10px;
}
.grids.columns2 {
    -webkit-column-count: 2;
    -moz-column-count: 2;
    column-count: 2;
}
.grids.columns4 {
    -webkit-column-count: 4;
    -moz-column-count: 4;
    column-count: 4;
}
.grids .gridElement {
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
}
.grids .gridElement:last-child {
    margin-bottom: 0;
}
.grids .gridElement img {
    min-width: 100%;
}
.
.
. (The rest of the CSS code is unchanged)
.
.
}

Answer №1

One interesting aspect of using overflow: hidden; is its requirement for fixed boundaries. In order for it to effectively hide overflow content, a specific height needs to be set for the .grids .gridElement class - such as 500px. This ensures that any overflowing content will remain concealed.

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

Please indicate the number of lines for the href within the span element

I'm struggling with formatting a <span> tag, specifically the .lastMessageLink class that contains an <a> element with the .lastMessageText class. The content within .lastMessageText can vary from just a few characters to a lengthy paragra ...

Using jQuery to scroll within a table

I am currently working on a project that involves displaying specific data rows. To achieve this, I have decided to use a table. For a better understanding, you can check out a table demo here. The issue I am facing is that whenever I change the selected ...

Ensure the width of an HTML table by using only the <td witdth> tag

How can I set a fixed width for each column in my HTML table without using the width property in CSS? The current code is not displaying the table properly, with it only rendering at 100% width of the screen. Here's a snippet of the relevant code: ...

Question About jQuery and CSS3

Can someone suggest an effective method for modifying CSS3 with jQuery? I was thinking of using a selector like this: $("#con_back").css('-webkit-border-top-right-radius','0px'); $("#con_back").css('border-top-right-radius', ...

"Activate the mat-checkbox based on the outcome of a certain process

I'm working with a mat-checkbox that triggers a mat-dialog when clicked. If the user clicks "confirm" in the dialog, I want the checkbox to be checked. If they click "cancel", I want it to remain unchecked. How can I achieve this? Below is the method ...

Rendering HTML5 and CSS3 on Internet Explorer 8

My coding knowledge is limited, but I am conducting research for our front-end developers. Our goal is to revamp our portal application using CSS 3 and HTML 5 in order to achieve an adaptive layout that can accommodate different browser widths. The curre ...

Trigger an alert message upon clicking a button within CK Editor

Is it possible to trigger an alert message using ckeditor when a specific button is clicked? Below is the code snippet for reference: $(document).ready(function () { $(".cke_button__bold").click(function () { editor.on("CKEDITOR.cke_butto ...

What are the steps for implementing the Ionic 2 Pulling Refresher feature in my application?

Hey everyone, I'm currently working on developing a mobile app using AngularJS 2/Ionic2. I am facing an issue with implementing a pull-to-refresh feature in my app. We followed the steps outlined in this link, and while we were able to get the page to ...

HTML: keeping script for future use in a variable

Is there a way to store a value in one place within an HTML document without the need for a database or PHP? Avoiding the repetition of typing the same value multiple times is the goal. Consider the following scenario: HTML <!-- Desktop --> <di ...

Working with AngularJS to Create Repeated Divs and Buttons

Currently, I'm looking to utilize ng-repeat to iterate over a div that contains a button. At the moment, I am achieving this by generating the div and button in the JavaScript section and then adding the final outcome to an array: var newDiv = docum ...

Create a line break in an alert using PHP

<?php function alert($msg) { echo "<script type='text/javascript'>alert('$msg');</script>"; } if(array_key_exists('btnRegisterAdmins', $_POST)) { $fname = $_POST['FirstName']; $lname=$_POST['La ...

Tips for eliminating the additional space on the right side of MUI grid components

The MUI grid example displayed below appears to leave an additional space on the right side of the grid, giving the impression that it does not fully occupy the available space on the page. https://i.sstatic.net/Q6sgB.png I have attempted to adjust/remov ...

Is there a method to identify if the dark theme is enabled in iBooks while working within an EPUB file?

Is there a specific code or feature that iBooks uses to enable the customization of certain sections within the book, such as changing to lighter colors when night mode is on? ...

When using the `display: block;` property within a `code` tag nested inside a `pre` tag, it results in unexpected line breaks and incomplete styling when scrolling

I am trying to create a zebra striped code sample using HTML and CSS. However, when I run the code snippet below, it adds unwanted new lines and does not apply the styling properly when using the scroll bar. How can I resolve this issue? <!DOCTYPE h ...

Using clip-path in SVG works perfectly on images, but unfortunately it does not work on div

I came across an interesting example on MDN about using a clip-path SVG on an image. However, it seems that the same clip-path does not work properly when applied to a div. Can anyone shed some light on: The reason why this code is not achieving the inte ...

The background-size property fails to function properly on mobile devices

It's really puzzling why this issue is happening, perhaps it's due to my fatigue. The problem lies in the fact that the "background-size" property isn't functioning on my mobile devices; however, it works perfectly when I try to simulate it ...

Reach out to us using our Gmail contact form

Hey there! I've been working on setting up a contact form to connect with my Gmail account. I tried the traditional method of creating an HTML form and PHP file to use the mail() function, but it's not functioning properly. My goal is to have a ...

The Carousel Slider seems to encounter issues when trying to implement it with *ngFor in Angular 8

Currently tackling an issue in Angular 8 where my slider functions perfectly with static data. However, upon attempting to loop through some dynamic data, the 'left' and 'right' buttons on the carousel cease to work. The images also fai ...

Original selection unavailable in pagination

I'm encountering an issue on my website where Bootstrap and JQuery don't seem to work well together. $("ul.pagination li:not(.active) a").on("click",function(){ $(".pagination li.active").removeClass("active"); $(this).parent().addClass("activ ...

Struggling to make the fancybox feature function with html/php

I've been trying to find a solution to this problem repeatedly, but I just can't seem to crack it. All I want to do is use fancybox to display an image. Since this is my first time using fancybox, I'm sure someone with more experience will ...