What is causing the items under my "content" class to appear faded in the active column?

Can anyone explain why the content below the "content" class in each column is faded? I would like only the active column to be visible (works somewhat) and the non-active columns to be faded.

Live Test Version: http://jsfiddle.net/Gc68V/

HTML Code:

<div id="container">
    <div id="header-bar">
        <ul>
            <li>
                <a href="gallery.html">Gallery</a>
            </li>
            <li>
                <p>| Dare.me |</p>
            </li>
            <li>
                <a href="leaderboard.html">Leaderboard</a>
            </li>
        </ul>
    </div><!--header-bar-->

    <div class="columns">
        <div id="left-column">
            <p class="title left">Easy</p>
            <p class="content">Feeling like a whimp?<br/> 
            Take one of our easy dares.</p>

            <div class="circle-text"><div><a href="php/easy.php">Click <span class="bold">Here</span> For An Easy Dare</a></div></div>

            <div id="test"><p>Test Text</p></div>

        </div><!--left-column-->

        <div id="centre-column">
            <p class="title centre">Medium</p>
            <p class="content">Feeling adventurous<br /> are we?</p>

            <div class="circle-text"><div><a href="php/medium.php">Click <span class="bold">Here</span> For A Medium Dare</a></div></div>

        </div><!--centre-column--> 

        <div id="right-column">
            <p class="title right">Hard</p>
            <p class="content">Feeling lucky?<br /> prepare yourself!</p>

            <div class="circle-text"><div><a href="php/hard.php">Click <span class="bold">Here</span> For A Hard Dare</a></div></div>

        </div><!--right-column-->
    </div><!--columns-->
 </div><!--container-->

Here's the CSS:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* Fonts */

@font-face {
    font-family: 'code_boldregular';
    src: url('../fonts/code_bold-webfont.eot');
    src: url('../fonts/code_bold-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts...

Answer №1

When you input the following code...

.columns:hover div{  
  transition: opacity linear .2s;    
  opacity:0.3;
}

...you are essentially commanding a fading effect on every <div> element that is nested within .columns.

To target only the direct child elements, you should use the child CSS selector:

.columns:hover > div{  
  transition: opacity linear .2s;    
  opacity:0.3;
}

http://jsfiddle.net/Gc68V/1/

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

Incorporating image URI into HTML for validation purposes

My website validation is encountering issues, mainly due to data/images base64 URIs. I ran a diagnosis on Error: Malformed byte sequence: e9. At line 2, column 259 (etc.) The analysis from https://validator.w3.org/ simply states that it cannot anal ...

Issue with using Ajax form in conjunction with jquery append method

This particular code snippet appears to be functioning, however, it seems to be missing the invocation of the ajax form chat_process.php. I require the ajax form to be called and display an alert message. var html = ""; for(...) { html += '<f ...

Enhance the appearance of the initial row in the v-data-table component within vuetify

I have utilized the Vuetify data table component to define the table shown below. My current challenge involves figuring out how to make the first row of the table appear in bold. Specifically, I want the text of the first item record to be bold. Any ass ...

Limit the rotation of jQuery and CSS3 elements to always turn in a clockwise direction

Utilizing the jQuery transit plugin, I am rotating a block element with 4 navigation controls. Each time a nav item is clicked, the block rotates to the specified custom data attribute of that nav item - either 0, 90, 180, or 270 degrees. While I have suc ...

Use Javascript's JQuery library to apply functionality to a newly inserted and cloned

I am facing an issue while trying to implement JQueryUI's DatePicker on a node. It works perfectly fine for all the existing nodes, but when I use the clone function to add new nodes, it doesn't seem to apply as expected. Here is the function th ...

"Troubleshooting Issue: JavaScript and jQuery onClick Event Not Functioning Properly

Whenever I try to click on the "php1" div, nothing happens. The location.reload() function is only a placeholder used for testing if the onClick event is functioning properly. <div class="php-task"> <h1>PHP</h1> ...

How can I utilize a JSON object in Scala to establish a database connection through JavaScript?

Recently diving into Scala and Play, I am currently learning how to work with a JSON object. I need to send this JSON object to my Scala controller class and then connect it to the database for storage. However, I'm not quite sure how to go about doin ...

Ensure that the hover div remains open even after the mouse leaves, and only closes when clicked outside of the div window or on a

I have a jQuery script that controls the opening and closing of the "shopping_cart" div when hovering over the "shopping_button". $('#shopping_button, .shopping_cart').on('mouseenter',function(){ $(this).css('z-index',&apos ...

Creating a responsive layout in HTML/CSS where the div element expands to fill the entire vertical space of its parent

Looking for assistance in creating a webpage layout like the one shown in this fiddle... http://jsfiddle.net/jeljeljel/5BSva/ I need the vertical line on the left side navigation tab to extend all the way down to the footer at the bottom of the page. Th ...

Loading logos dynamically using Jquery upon selection of an option

In the form I created, there is a dropdown logo selection at the bottom. The options in the dropdown are populated from folders in the root directory using the following code: $dirs = glob('*', GLOB_ONLYDIR); Each of these directories contain ...

Finding your current location and address using HTML5 geolocation

My web application utilizes HTML5 geolocation to obtain latitude and longitude coordinates. I am looking for a way to convert these coordinates into actual addresses whenever possible. Once that is done, I need to save the address information into a MySQ ...

Is there a way to verify that all CSS files have been successfully downloaded before injecting HTML with JavaScript?

I am looking to dynamically inject HTML content and CSS URLs using JavaScript. I have more than 3 CSS files that need to be downloaded before the content can be displayed on the page. Is there a way to check if the aforementioned CSS files have finished ...

What is the best method to adjust the scrollbar to the correct position on the table?

Currently facing an issue with adding a scrollbar on the right side of my table. I have tried using a jQuery plugin called table_scroll.js but encountering difficulties. The problem can be seen in this image: https://i.sstatic.net/XqLBD.png. Any assistan ...

Choose past dates and display the current date using the Bootstrap datetimepicker

I've encountered a challenge in displaying the current day while still allowing selection of past dates. When I set the start date as today's date, I am unable to choose past dates. However, if I remove the parameter startDate: new Date(), I can ...

Beginning the default execution right away

Currently employing jQuery. This is my code snippet: $("#input").keypress(function(event) { getConversion(); }); Is there a way to ensure that the key pressed is first added to #input before triggering the getConversion() function? ...

"Combining Angular and jQuery for powerful web development

I am looking to develop an application using Angular and incorporate numerous jQuery animations and jQuery UI effects (such as animate, fadeIn, fadeOut, etc). Is it feasible to use jQuery functions in conjunction with Angular? ...

Is there a way to dynamically alter the background style of a div by clicking on it multiple times using Javascript?

I am attempting to create a calendar where each day changes its background color between blue and green when clicked, using JavaScript and CSS. It should function similar to a toggle feature. The default color is blue, and I have successfully made the days ...

Modify the useRef value prior to the HTML rendering (React functional component)

Hello everyone, I am attempting to update the value of useRef before the HTML is rendered. I have tried using useEffect for this purpose, but it runs after the HTML is ready, making it unsuitable for my needs. What I want to achieve is resetting the value ...

How come jQuery is retaining the original DOM element classes even after I have modified them using jQuery?

Here is the code snippet I am working on: $(".drop-down-arrow-open i").click(function(){ console.log("The click function for .drop-down-arrow-open is triggered even when it is closed"); let thisParent = $(this).closest(".projects-container").find(".need ...

Python Selenium: How to locate elements using xpath in the presence of duplicate elements within the HTML code

Currently, I am utilizing selenium to extract data from a liquor sales website to streamline the process of adding product information to a spreadsheet. My workflow involves logging into the website using selenium and searching for the specific product. Wh ...