Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times

    CSS be difficult

    So I have some css, and html, I'm trying to get some text to fade in, or even just appear when something else is hovered over, but it's proving challenging, any help?
    Code:
    .one{
                    height:20px;
                    margin-top:-300px;
                    margin-left:20%;
                    display:none;
                }
    
    
                .two{
                    height:20px;
                    margin-top:-300px;
                    margin-left:46%;
                    display:none;
                }
    
    
                .three{
                    text-align:right;
                    height:20px;
                    margin-top:-300px;
                    margin-left:0;
                    width:48%;
                    display:none;
                }
    
    
                .four{
                    text-align:right;
                    height:20px;
                    margin-top:-300px;
                    margin-left:0;
                    width:75%;
                    display:none;
                }
    
    
                .img-one:hover~.feature-text.one:after{
                       display:block;
                }
    
    
                .img-two:hover~.feature-text.two:after{
                       display:block;
                }
    
    
                .img-three:hover~.feature-text.three:after{
                       display:block;
                }
    
    
                .img-four:hover~.feature-text.four:after{
                       display:block;
                }
    
    
                .features{
                    opacity:1;
                }
    
    
                .features:hover>.f:not(:hover){
                    opacity:0;
                    -webkit-animation: tout 0.5s; /* Chrome, Safari, Opera */
                       animation: tout 0.5s;
                }
    Code:
    <div class="features">
                <div class="feature-text">
                    <div class="feature-text-span one"><span class="feature title">Presto!</span><br />Even the simplest of code can seem like magic during execution, just be careful you don't build skynet</div>
                    <div class="feature-text-span two"><span class="feature title">Need some help?</span><br />We've got experts in almost every computer feild present at our meetings, so ask away!</div>
                    <div class="feature-text-span three"><span class="feature title">Learn the process</span><br />Learn how to prototype, work with others, and write code for your very own robot.</div>
                    <div class="feature-text-span four"><span class="feature title">Shoot for the stars</span><br />In 2013, the autonomous code we wrote for our bot got us in thrid place, anythings possible</div>
                </div>
                <img src="svg/magic.svg" class="fimg f img-one" width="20%"/>
                <img src="svg/safe.svg" class="fimg f img-two" width="20%"/>
                <img src="svg/pencils.svg" class="fimg f img-three" width="20%"/>
                <img src="svg/earth.svg" class="f img-four" width="20%"/>
            </div>
    Hey you! Go make something!

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    IIRC, you have to put a space with the child selector:
    Code:
    .features:hover > .f:not(:hover)
    Also, that selector seems a bit funky. You're telling it on hover to select a child that is not hovered, which I don't think works, since the hover pseudo on the parent includes the child. Someone correct me if I'm off base here.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times
    on that selector, I have a container for four images, and when that is hovered, I want the images that aren't hovered on to change opacity to 0, and the one that is to stay at full opacity. The real problem is that the code below doesn't work, I have tried just about everything I can think of, surprisingly the other, insane css selector works perfectly.

    Code:
    .img-four:hover~.feature-text.four:after{
         display:block
     }
    Hey you! Go make something!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com