targetを使う
こんな面白いCSSの使い方をしている方がいたのですが、
HPが崩れていたので消される前にメモしておきました。
<p id="menu"> <a id="menu1" href="#text1">テキスト1</a> <a id="menu2" href="#text2">テキスト2</a> <a id="menu3" href="#text3">テキスト3</a> <a id="menu4" href="#text4">テキスト4</a> <a id="menu5" href="#text5">テキスト5</a> </p> <div id="text1"> <h2>テキスト1</h2> <p> テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。</p> </div> <div id="text2"> <h2>テキスト1</h2> <p> テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。</p> </div> <div id="text3"> <h2>テキスト1</h2> <p> テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。</p> </div> <div id="text4"> <h2>テキスト1</h2> <p> テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。</p> </div> <div id="text5"> <h2>テキスト1</h2> <p> テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。テキスト1の本文です。</p> </div>
参考文献のサンプルhttp://builder.japan.zdnet.com/story_media/20387833/samp_target.html
参考文献http://builder.japan.zdnet.com/html-css/20387833/