Activity Stream
48,167 MEMBERS
61938 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Member
    Website's:
    PornShareProject.org MidnightDesires.org

    Default HTML5/CSS3 hover error

    Why does this work, but when I add #container it no longer works?


    Works just fine:
    PHP Code: 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <
    html>
    <
    head>

    <
    style type="text/css"
    stage2
    {
    display:none;
    color:black;
    width:100px;
    height:100px;
    background:white;
    animation:myfirst 9s;
    -
    moz-animation:myfirst 9s/* Firefox */
    -webkit-animation:myfirst 5s/* Safari and Chrome */  

    }

    .
    stage2:hover stage2{
        
    display:inline;

    </
    style>

    </
    head>
    <
    body>

    <
    class="stage2" href="#">Hover over me!</a>

    <
    stage2>this is the content for stage2</stage2>


    </
    body>
    </
    html
    No longer working due to #container
    PHP Code: 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <
    html>
    <
    head>

    <
    style type="text/css"
    stage2
    {
    display:none;
    color:black;
    width:100px;
    height:100px;
    background:white;
    animation:myfirst 9s;
    -
    moz-animation:myfirst 9s/* Firefox */
    -webkit-animation:myfirst 5s/* Safari and Chrome */  

    }

    #container .stage2:hover + stage2{
        
    display:inline;

    </
    style>

    </
    head>
    <
    body>

    <
    div id="container">
        <
    class="stage2" href="#">Hover over me!</a>
    </
    div>

    <
    stage2>this is the content for stage2</stage2>


    </
    body>
    </
    html
    What am I doing wrong?
    AlternativeWeb Reviewed by AlternativeWeb on . HTML5/CSS3 hover error Why does this work, but when I add #container it no longer works? Works just fine: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> stage2 Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Because in the second code, you are trying to select stage2 inside #container
    PHP Code: 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <
    html>
    <
    head>

    <
    style type="text/css"
    stage2
    {
    display:none;
    color:black;
    width:100px;
    height:100px;
    background:white;
    animation:myfirst 9s;
    -
    moz-animation:myfirst 9s/* Firefox */
    -webkit-animation:myfirst 5s/* Safari and Chrome */  

    }

    #container .stage2:hover + stage2{
        
    display:inline;

    </
    style>

    </
    head>
    <
    body>

    <
    div id="container">
        <
    class="stage2" href="#">Hover over me!</a>

        <
    stage2>this is the content for stage2</stage2>
    </
    div>


    </
    body>
    </
    html
    That works

    The adjacent sibling selector matches only if both of them are from same parent element i.e. #container in this case

  4.     
    #3
    Member
    Website's:
    PornShareProject.org MidnightDesires.org
    Thanks for clearing that up for me, Soft!

    I don't know how I missed that.. . sigh, need more Redbull -- haha!

    ---------- Post added at 02:10 PM ---------- Previous post was at 12:12 PM ----------

    Maybe you or someone can help me out with another issue i'm having.

    On rollover the text should popout and the image should change to a different one, but in the code below, the image doesn't change.

    What what is the correct way to do this?


    PHP Code: 
    <head>

    <
    style type="text/css"
    stage2
    {
    display:none;
    color:black;
    width:100px;
    height:100px;
    }
    .
    container {
        
    background-imageurl(http://boallen.com/assets/images/randbitmap_true.png);
        
    background-repeatno-repeat;
        
    background-positionright bottom;
        
    height300px;
        
    width1000px;
    }

    .
    stage2:hover + .container {
        
    background-imageurl(http://www.presort.com/wp-content/uploads/random-numbers.png);
    }

    .
    stage2:hover stage2{
        
    display:inline;

    </
    style>

    </
    head>
    <
    body>


    <
    div class="container">
        <
    class="stage2" href="#">Hover over me!</a>
        <
    stage2>this is the content for stage2</stage2>
        
    </
    div>


    </
    body>
    </
    html

  5.     
    #4
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Nope, you can't do that directly with CSS. You would have to use javascript side by side too: https://developer.mozilla.org/en/DOM...nt.onmouseover

  6.     
    #5
    Member
    Website's:
    PornShareProject.org MidnightDesires.org
    Thanks for clearing that up for me.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HTML5 CSS3 Webtemplate Free
    By flanker in forum Contests & Giveaways
    Replies: 0
    Last Post: 1st Aug 2012, 05:18 PM
  2. [For Hire] Cheap PSD to HTML5+CSS+CSS3 Service
    By Apathetic in forum Completed Transactions
    Replies: 25
    Last Post: 8th May 2012, 05:34 AM
  3. [Hiring] Call for a professional coder (php, html5, css3)
    By yudianto79 in forum Completed Transactions
    Replies: 0
    Last Post: 29th Oct 2011, 04:33 PM
  4. Convert to HTML5\CSS3 or Not ?
    By SMOKING in forum Webmaster Discussion
    Replies: 1
    Last Post: 22nd Sep 2011, 07:38 PM
  5. proxy2surf.com new skin with CSS3
    By Zeokat in forum Site Reviews
    Replies: 4
    Last Post: 29th Sep 2010, 09:45 PM

Tags for this Thread

BE SOCIAL