html5 - display specific div on hover? using css and html only -


I want to show the second div (in HTML) with div Hover over the anger tag on the cursor.

HTML code:

  & lt; A & gt; Hover over me & lt; / A & gt; & Lt; Div class = "forget" & gt; Sdjfg & lt; / Div & gt; & Lt; Div class = "dikha" & gt; The content shown on the hover & lt; / Div & gt;   

Style

  div {display: none; } A: hover & gt; Div: nth-child (2) {display: block; Background color: red; Height: 250px; Width: 960px; }    

Use the adjacent sibling selector ~ need to . Besides, the div you want to show is the third child, not the second (because is the first).

  div {display: none; } A: hover ~ div: nth-child (3) {display: block; Background color: red; Height: 250px; Width: 960px; }   

Demo:

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -