<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="author" content="Maik" />
<meta name="date" content="2010-03-08" />
<title>tutorials.de | :hover-Selectors</title>
<style type="text/css">
<!--
/* Allg. CSS-Einstellungen */
/* .wrapper */
div.wrapper {
width:600px;
margin:auto;
font:normal .85em verdana, sans-serif;
}
div.wrapper * {
margin:0;
padding:0;
}
div.wrapper li {
list-style:none;
margin-top:20px;
font-size:0.9em;
}
div.wrapper li p {
margin:10px;
}
div.wrapper h2 {
font-size:1.8em;
font-weight:bold;
border-bottom:1px solid #b5bfca;
color:#b5bfca;
}
div.wrapper h2 span {
position:relative;
top:-6px;
padding:3px 10px;
border-bottom:3px solid #b5bfca;
}
div.wrapper h3 {
font-size:1.6em;
font-weight:bold;
border-bottom:1px solid #b5bfca;
color:#b5bfca;
}
div.wrapper h3 span {
position:relative;
top:-6px;
padding:3px 10px;
border-bottom:3px solid #b5bfca;
}
div.wrapper div {
margin-top:10px;
border:1px solid #cfcfcf;
}
/* .clearfix */
.clearfix:after {
content:".";
display:block;
height:0;
font-size:0;
clear:both;
visibility:hidden;
}
.clearfix {display:inline-block;}
/* Hides from IE-mac \*/
* html .clearfix {height:1%;}
.clearfix {display:block;}
/* End hide from IE-mac */
/* ENDE Allg. CSS-Einstellungen */
/* TEIL 1 - :HOVER-EFFEKT */
div.parentBox {
padding:5px;
background:#fdfdfd;
color:#555;
}
/* Nachfahren-Selektor */
div.parentBox div#descendantBox_1 {
padding:5px;
background:#f3f3f3;
color:#2f2f2f;
}
div.parentBox:hover div#descendantBox_1 {
background:#3968a6;
color:#fff;
}
/* ENDE Nachfahren-Selektor */
/* Kind-Selektor */
div.parentBox > div#childBox_1 {
padding:5px;
background:#f3f3f3;
color:#2f2f2f;
}
div.parentBox:hover > div#childBox_1 {
background:#3968a6;
color:#fff;
}
/* ENDE Kind-Selektor */
/* Nachbar-Selektor */
div#adjacentBox_1 {
float:left;
width:285px;
padding:5px;
background:#fdfdfd;
color:#555;
}
div#siblingBox_1 {
float:left;
width:285px;
margin-left:5px;
padding:5px;
background:#f3f3f3;
color:#2f2f2f;
}
div#adjacentBox_1:hover + div#siblingBox_1 {
background:#3968a6;
color:#fff;
}
/* ENDE Nachbar-Selektor */
/* ENDE TEIL 1 - :HOVER-EFFEKT */
/* TEIL 2 - CSS-POPUP */
div.parentBox {
position:relative;
}
/* Nachfahren-Selektor */
div.parentBox div#descendantBox_2 {
visibility:hidden;
display:none;
}
div.parentBox:hover div#descendantBox_2 {
visibility:visible;
display:block;
position:absolute;
top:-5px;
right:5px;
background:#3968a6;
color:#fff;
font-weight:bold;
width:150px;
line-height:75px;
text-align:center;
}
/* ENDE Nachfahren-Selektor */
/* Kind-Selektor */
div.parentBox > div#childBox_2 {
visibility:hidden;
display:none;
}
div.parentBox:hover > div#childBox_2 {
visibility:visible;
display:block;
position:absolute;
top:-5px;
right:5px;
background:#3968a6;
color:#fff;
font-weight:bold;
width:150px;
line-height:75px;
text-align:center;
}
/* ENDE Kind-Selektor */
/* Nachbar-Selektor */
div#adjacentBox_2 {
float:left;
width:285px;
padding:5px;
background:#fdfdfd;
color:#555;
}
div#siblingBox_2 {
visibility:hidden;
display:none;
}
div#adjacentBox_2:hover + div#siblingBox_2 {
visibility:visible;
display:block;
float:left;
width:285px;
margin-left:5px;
padding:5px;
background:#3968a6;
color:#fff;
}
/* ENDE Nachbar-Selektor */
/* ENDE TEIL 2 - CSS-POPUP */
-->
</style>
</head>
<body>
<div class="wrapper">
<ul class="clearfix">
<li><h2><span>Teil 1: :hover-Effekt</span></h2>
<ul>
<li><h3><span>Nachfahrenelement</span></h3>
<div class="parentBox">
<p>parentBox</p>
<p>parentBox</p>
<div id="descendantBox_1">descendantBox_1</div>
</div>
</li>
<li><h3><span>Kindelement</span></h3>
<div class="parentBox">
<p>parentBox</p>
<p>parentBox</p>
<div id="childBox_1">childBox_1</div>
</div>
</li>
<li><h3><span>Nachbarelement</span></h3>
<div id="adjacentBox_1">
<p>adjacentBox_1</p>
<p>adjacentBox_1</p>
</div>
<div id="siblingBox_1">
<p>siblingBox_1</p>
<p>siblingBox_1</p>
</div>
</li>
</ul>
</li>
</ul>
<ul class="clearfix">
<li><h2><span>Teil 2: CSS-Popup</span></h2>
<ul>
<li><h3><span>Nachfahrenelement</span></h3>
<div class="parentBox">
<p>parentBox</p>
<p>parentBox</p>
<p>parentBox</p>
<div id="descendantBox_2">descendantBox_2</div>
</div>
</li>
<li><h3><span>Kindelement</span></h3>
<div class="parentBox">
<p>parentBox</p>
<p>parentBox</p>
<p>parentBox</p>
<div id="childBox_2">childBox_2</div>
</div>
</li>
<li><h3><span>Nachbarelement</span></h3>
<div id="adjacentBox_2">
<p>adjacentBox_2</p>
<p>adjacentBox_2</p>
</div>
<div id="siblingBox_2">
<p>siblingBox_2</p>
<p>siblingBox_2</p>
</div>
</li>
</ul>
</li>
</ul>
</div>
</body>
</html>