
HTML
Button
Images
Rollover
Loading...
<a href="http://design-grafixx.com" id="rollover"> </a>
a#rollover{ width: 156px; /* Breite */ height: 51px; /* Hoehe */ display: block; /* Element wird als Block-Element dargestellt */ outline: none; /* unterdrueckt gestrichelten Rahmen */ background: url(normal.jpg) no-repeat; /* Hintergrundgrafik */ } a#rollover:hover { background: url(hover.jpg) no-repeat; /* Hintergrundgrafik */ }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Rollover mit CSS</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="Tutorial, (x)HTML, CSS, Rollover, Alice, Grafixx" /> <meta name="description" content="Beispielseite zum Tutorial CSS Rollover | Alice-Grafixx.de" /> <style type="text/css"> body{ margin: 10px; text-align: center; background: #ddd; font: normal 0.9em Tahoma, sans-serif; } #ram{ text-align: left; border: 1px solid #eee; margin: 10px auto; padding: 15px; width: 750px; background: #fff; } h1{ font-size: 1.4em; color: #758896; } a{ float: left; } /* erster Button ----------------------------------------------------------------------- */ a#rollover{ width: 156px; /* Breite */ height: 51px; /* Hoehe */ display: block; /* Element wird als Block-Element dargestellt */ outline: none; /* unterdrueckt gestrichelten Rahmen */ background: url(normal1.jpg) no-repeat; /* Hintergrundgrafik */ } a#rollover:hover { background: url(hover1.jpg) no-repeat; /* Hintergrundgrafik */ } /* zweiter Button ----------------------------------------------------------------------- */ a#rollover1{ width: 156px; /* Breite */ height: 51px; /* Hoehe */ display: block; /* Element wird als Block-Element dargestellt */ outline: none; /* unterdrueckt gestrichelten Rahmen */ background: url(normal2.jpg) no-repeat; /* Hintergrundgrafik */ } a#rollover1:hover { background: url(hover2.jpg) no-repeat; /* Hintergrundgrafik */ } /* dritter Button ----------------------------------------------------------------------- */ a#rollover2{ width: 156px; /* Breite */ height: 51px; /* Hoehe */ display: block; /* Element wird als Block-Element dargestellt */ outline: none; /* unterdrueckt gestrichelten Rahmen */ background: url(normal3.jpg) no-repeat; /* Hintergrundgrafik */ } a#rollover2:hover { background: url(hover3.jpg) no-repeat; /* Hintergrundgrafik */ } </style> </head> <body> <div id="ram"> <h1>Rollover-Buttons mit CSS</h1> <p> <a href="http://alice-grafixx.de" id="rollover"></a> <a href="http://unnecessary.de" id="rollover1"></a> <a href="http://design-grafixx.com" id="rollover2"></a> <br /><br /> </p> </div> </body> </html>
<a href="http://design-grafixx.com" class="rollover">Design-Grafixx</a> <a href="http://alice-grafixx.de" class="rollover">Alice-Grafixx</a> <a href="http://unnecessary.de" class="rollover">Unnecessary</a> <a href="http://sweet-pearls.com" class="rollover">Sweet-Pearls</a>
a.rollover{ padding-top: 17px; /* Innenabstand des Elements von oben */ width: 156px; /* Breite */ height: 35px; /* Hoehe */ display: block; /* Element wird als Block-Element dargestellt */ outline: none; /* unterdrueckt gestrichelten Rahmen */ background: url(grafik1.jpg) no-repeat; /* Hintergrundgrafik */ font-size: 1.0em; /* Schriftgroesse */ font-weight: bold; /* Schriftdicke */ font-family: Arial, Tahoma, sans-serif; /* Schriftart */ color: #fff; /* Textfarbe */ text-align: center; /* Textausrichtung */ text-decoration: none; /* Link wird nicht unterstrichen */ } a.rollover:visited { color: #B4B5B9; /* Schriftfarbe */ background: url(grafik2.jpg) no-repeat; /* Hintergrundgrafik */ } a.rollover:hover { color: #CFE4FF; /* Schriftfarbe */ background: url(grafik2.jpg) no-repeat; /* Hintergrundgrafik */ }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Rollover mit CSS</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="Tutorial, (x)HTML, CSS, Rollover, Alice, Grafixx" /> <meta name="description" content="Beispielseite zum Tutorial CSS Rollover | Alice-Grafixx.de" /> <style type="text/css"> body{ margin: 10px; text-align: center; background: #ddd; font: normal 0.9em Tahoma, sans-serif; } #ram{ text-align: left; border: 1px solid #eee; margin: 10px auto; padding: 15px; width: 750px; background: #fff; } h1{ font-size: 1.4em; color: #758896; } a{ float: left; } /* Buttons ----------------------------------------------------------------------- */ a.rollover{ width: 156px; /* Breite */ height: 34px; /* Hoehe */ padding: 17px 0px 0px 0px; /* Innenabstand */ display: block; /* Element wird als Block-Element dargestellt */ outline: none; /* unterdrueckt gestrichelten Rahmen */ background: url(grafik1.jpg) no-repeat; /* Hintergrundgrafik */ font-size: 1.0em; /* Schriftgroesse */ font-weight: bold; /* Schriftdicke */ font-family: Arial, Tahoma, sans-serif; /* Schriftart */ color: #fff; /* Schriftfarbe */ text-align: center; /* Textausrichtung */ text-decoration: none; /* Link wird nicht unterstrichen */ } a.rollover:visited { color: #B4B5B9; /* Schriftfarbe */ background: url(grafik2.jpg) no-repeat; /* Hintergrundgrafik */ } a.rollover:hover { color: #CFE4FF; /* Schriftfarbe */ background: url(grafik2.jpg) no-repeat; /* Hintergrundgrafik */ } </style> </head> <body> <div id="ram"> <h1>Rollover-Buttons mit CSS</h1> <p><a href="http://design-grafixx.com" class="rollover">Design-Grafixx</a> <a href="http://alice-grafixx.de" class="rollover">Alice-Grafixx</a> <a href="http://unnecessary.de" class="rollover">Unnecessary</a> <a href="http://sweet-pearls.com" class="rollover">Sweet-Pearls</a> <br /> <div style="clear: left;background: #000;">huhuh</div> <br /> </p> </div> </body> </html>
Du musst angemeldet sein, um einen Kommentar zu hinterlassen...
Du bist noch kein Mitglied von Alice-Grafixx.de?
Dann kannst du dich hier kostenlos registrieren ...