I have a an area of code on my site that I want to make dynamic and what to know how is the best way to do it. When each of the headers is hovered over I want the content in the "text test" area to change. Is this possible with css or does it need to be done with js? I was thinking the accordion code might do it, but I'm not sure how.
You cannot do what you are asking with pure CSS. (By the way, you do realize that this is not a good way to develop a website, right? Unless you have a client who is asking for it, of course)
Some users might find that to be annoying, IMO. Also, some people browse the web with JavaScript disabled (which prevents your thing from working).
Try this out, <!DOCTYPE html> <head> <style type="text/css"> body{} #content-menu{float:left;} #content-wrap{float:left;margin-left:20px;} .hidden-content{display:none;} .default{display:block;} </style> </head> <body> <ul id="content-menu"> <li><a href="#" class="content-load" data-content="#div1">content 1</a></li> <li><a href="#" class="content-load" data-content="#div2">content 2</a></li> <li><a href="#" class="content-load" data-content="#div3">content 3</a></li> </ul> <div id="content-wrap"> <div id="div1" class="hidden-content default"> <h1>Div 1 Content</h1> <p>This is the content of hidden div1</p> </div> <div id="div2" class="hidden-content"> <h1>Div 2 Content</h1> <p>This is the content of hidden div2</p> </div> <div id="div3" class="hidden-content"> <h1>Div 3 Content</h1> <p>This is the content of hidden div3</p> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> $('.content-load').hover(function() { // set the div to be shown var content = $(this).data('content'); // hide all content divs $('.hidden-content').hide(); // show the selected div $(content).show(); }); </script> </body> HTML: