Can someone help clear up this confusion with CSS?

Why is image 6.png selected, when all the images are direct descendants of the div shape? Thank you for your assistance, it's greatly appreciated. As far as I know, it should select all the divs because they are all direct descendants of the div #shape.

<!DOCTYPE html>
<html>
<head>
    <title>3D image</title>
    <style>
    body,html{
        width:100%; 
        height:100%;
        overflow:hidden;
    }

    body{
        background:-webkit-gradient(radial,800 
               64,950, 500, 400, 40, from(#1F1F1F),  to(#FFFFFF));
    }

    #container{
        width:100%;
    }

    #shape{
        position:relative;
        top:160px;
        margin: 0 auto;
        width:200px;
        height:200px;
    }

    #shape > div{
        position:absolute;
        height:200px;
        width:200px;
        border:1px solid #e3e3e3;
        -webkit-border-radius:10px;
    }
</style>
</head>
<body>
<div id="container">
    <div id="shape">
        <div class="one"><a href="http://www.bbc.co.uk/persian"><img src="images/2.png"></a></div>
        <div class="two"><a href="http://www.aljazeera.com"><img src="images/3.png"></a></div>
        <div class="three"><a href="http://www.bbc.co.uk/news"><img src="images/4.png"></a></div>
        <div class="four"><a href="http://www.yahoo.com"><img src="images/1.png"></a></div>
        <div class="five"><a href="http://www.html5nurse.com"><img  src="images/5.png"></a></div>
        <div class="six"><a href="http://www.cnn.com"><img src="images/6.png"></a></div>
    </div>
</div>
</body>
</html>

Answer №1

Every single one has been chosen.

They are all stacked on top of each other, meaning they share the identical location.

Answer №2

Substitute

#shape > div{
    position:relative;
    float: left;
    height:200px;
    width:200px;
    border:1px solid #e3e3e3;
    -webkit-border-radius:10px;
}

instead of

#shape > div{
    position:absolute;
    height:200px;
    width:200px;
    border:1px solid #e3e3e3;
    -webkit-border-radius:10px;
}

Observe the difference it makes.

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

Choose each day's time slot on the jQuery FullCalendar version 2.x

The code snippet below is a segment of the code generated by the FullCalendar jQuery plugin version 2. It has undergone some changes from version 1.x in terms of the classes it utilizes. <div class="fc-slats"> <table> <tbody> ...

Dropdown menu for selecting state in multiple countries built with React JS

In my project, I'm attempting to create a dropdown menu that lists multiple countries along with their associated states by mapping over an array. The sample data from the array is shown below: [ { "country" : "USA", ...

jinja2.exceptions.UndefinedError: The variable 'asset' has not been defined

Currently in my project, I am using a Python backend to fetch data from an API and then rendering it through Flask to the Vue.js frontend. However, I have encountered an error titled that is causing some issues. I have double-checked and printed the varia ...

Press and hold feature using CSS or JavaScript

When working with a jQuery draggable element, my objective is to change the cursor to a move cursor when clicking and holding the header. I have attempted using CSS active and focus properties, but so far no changes are taking place. ...

The alignment of buttons is not defined for ASP buttons and Bootstrap dropdowns

I'm having an issue with the placement of my ASP button and button dropdown list. The dropdown always appears below the other buttons, but I want it to be in the same row as the other buttons. Below is a screenshot showing the current layout of the b ...

Rails and Materialize CSS icons encountering unexpected alignment issues

There's an unusual problem I'm facing with Materialize CSS's icons in a table. They don't align properly. I've attached a screenshot for reference (personal details blurred out). Screenshot Link Below is my Slim template code: ...

Tips for formatting a phone number using regular expressions in [Vue 2]

I am currently working on creating regex code that will meet the following requirements: Only allow the first character (0th index) in a string to be either a '+' symbol or a number (0-9). No non-numerical values (0-9) should be allowed anywhere ...

Essential symbol needed for labeling the user interface element

My HTML includes a dynamic label component where the 'required' value is determined by an API response that can be either true or false. Is it feasible to assign the property ojComponent{ required: true } for this label? *Date From ---- To --- ...

What is another option for toggling in jQuery?

After deprecating the toggle method, I found a new way to toggle div: $("#syndicates_showmore").on("click", function () { if (!clicked) { $('#syndicates').fadeTo('slow', 0.3, function () { $(this).css( ...

Employing forward slashes as the template delimiter in JavaScript for HTML

let a = 1.10; let html = '<div>'\ '<strong>' + a + '</strong>\ //error here </div>'; console.log(html) Can you identify the issue in the code above? The intention is to insert a variab ...

Creating layered images with CSS Grid

Visit this link for more details I've been attempting to create an overlap effect with 3 photos using CSS Grid. My desired outcome looks like this: Click here to see the desired result I followed tutorials that demonstrate the same method, but unfo ...

Are there alternative methods, aside from using a computed property, that can be utilized to store a Vue route parameter in a way where

In my Vue component, I am working on passing a route parameter through XHR requests and potentially using it in other areas as well. Initially, I considered storing it as a data attribute but realized that it could be modified by someone. Then it occurred ...

End node.js once and for all

After starting my server using forever start start.js It ran normally. However, when I attempted to stop it with forever stopall The server was removed from forever list as expected Nevertheless, upon running lsof -i tcp:3000, my server still showed u ...

Disappearance of the second level in a CSS dropdown menu

I am currently working on creating a dropdown menu using only CSS. Check out this example I'm using: http://jsfiddle.net/DEK8q/8/ My next step is to center the menu, so I added position-relative like this: #nav-container { position: rela ...

What steps should I take to prompt Postman to interact with a Web API?

I have recently installed the Postman plugin for Chrome and I am curious about how to use it to call my web API. Currently, I am making an AJAX call in JavaScript with the following code: alert("Getting security token"); // Do AJAX call to get security t ...

Tips for preventing the impact of angular mat-panel position changes on matdialog

In my Angular project, I utilized Matmenu and MatDialogModule. I needed to change the position of mat-menu, so I achieved this by adding the following snippet to my .scss file. ::ng-deep .cdk-overlay-pane { transform: translate(78%, 10%); } However, ...

"Enhance your website with the powerful autocompletion feature of

I am using Zend Framework to create a form element that utilizes Zend_Dojo_Form_Element_ComboBox. By setting dojox.data.QueryReadStore as the store type, I am able to generate a list of selectable values in my HTML input field. This allows me to either cho ...

What is causing the failure of these "span" elements within an "a" tag in IE7?

Here is a code snippet that I am working with: HTML (version 4.0) <div class="temperatura"> <a href="/link/" class="temperatura_localita"> <span style="padding-left:12px;"> T ...

Is there a way to upload a file using express/multer without triggering a redirect?

Note: Despite coming across this post, I couldn't find it helpful. Other related posts were focused on angular/react, which are not relevant to my current project. I have implemented a file upload feature that should provide a response indicating whe ...

AngularJS ng-focus does not function properly with iframes

Why isn't ng-focus working with iframe in AngularJS? What am I missing? Take a look at my code: <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> <iframe src="example.com" tabindex="-1" ng-fo ...