How do I customize the target class in CSS?

Is there a way to customize the parent class in CSS?

<div class="accountarea">
    <a class="auglink" href="/account">
        Account <i class="fa fa-angle-down icon-right"></i>
    </a>
    <div class="accountappear">
        <div class="accountforce">
            You are not logged in to an account.
            <form action="account.php" method="post">
                <input type="text" name="email" placeholder="E-mail Address" />
                <input type="password" name="password" placeholder="Password" />
                <input type="submit" name="login" value="Log In" class="minisubmit" />
            </form>
        </div>
        <div class="accountbottom">
            ddd
        </div>
    </div>
</div>

      

I need that if any input field in accountarea

has focus ( :focus

) then it accountarea

should remain visible (it is currently set to visibility on hover - I need both).

+3


source to share


1 answer


There is currently no way to select the parent element with CSS.

Using JavaScript is currently your best bet.



If jQuery is already loaded in your page, see Traverse tree docs

+2


source







All Articles