DSGN53871
WEB DESIGN 1
An ExampleMove your mouse over the image below - a red outline should appear. This was done using only 1 image, and without any JavaScript! The Style SheetThe key to making this work in all modern browsers is to define your links as block elements in your style sheet ( display: block ), and making the width the same as your image's ( eg. width: 32px ). Choose a background colour for your link that matches your page background and a second colour that you want for the rollover effect ( defined in a:hover ). For example: <style type="text/css"> This will create one rollover image per line. You can then use nested <div>
tags, tables, and/or CSS positioning to better control the placement of
these rollovers on your page. Why would you use CSS instead of Javascript?
<< Back Interactive Multimedia ~ School of Applied Engineering and Computing Sciences ~ Sheridan copyright 2005 http://www.uoguelph.ca/~stuartr/articles/cssrollovers.shtml |