CSS Image Gallery |
||||
47 views
Image Gallery The following image gallery is created with CSS: example: <html> <div class=”img”> </body> 2.. <html> <div class=”img”> </body> CSS Opacity.How much of the image do we want to see? All of it? Without any filters applied the opacity of an image. Just the words opacity and transparency are confusing. They are opposite ends of the spectrum as someone at Digg commented 10% opacity = 90% transparency. That’s it in a nutshell. Opacity is a little ditty that goes something like this. Opacity with onmouseover and onmouseoutThe CSS for div.transOFF {width: 100%; background-color: silver;border:1px solid black; } Image HoverApply the CSS defined opacity styles Text and Image HoverApply the CSS defined opacity styles Aligned Images HoverOpacity works in Mozilla and IE. It also works in current versions of Opera. The CSS3 specification for opacity The fact that image files are always rectangular can present some limitations in site design. It may be fine for pictures, but it is less desirable for logos, or for images that gradually fade into the background. For relatively simple web pages (such as the one that you are reading now), this restriction is easily worked around: simply match the background of your image to the background of your web page. If you pick the exact same color (easiest if using pure white), the rectangular boundary of your image will be invisible. This simple technique has been utilized for many of the graphics on this page. This technique is less successful if your background is more complex, however. If you use an image as a background, for example, you can’t just match one color. And because different web browsers have slight differences in how they display web pages, it’s basically impossible to try and match the background of your image to the background of your web page. What you really want to do is specify that regions of your image are transparent. The table below simulates a web page with an image-based background. By tagging the white regions of our image as transparent, the background image of the web page shows through.
Conclusion. Antialiasing and transparency are two tools that depend upon each other to get good results. Now that you know how they work, use them together to make quality, professional designs. <span style=”float:left;filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;”><img src=”http://www.computereducationworld.com/images/v90.gif” width=”50″ height=”50″></span> <span style=”float:left;filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;”><img src=”http://www.computereducationworld.com/images/v90.gif” width=”50″ height=”50″></span> <span style=”float:left;filter:alpha(opacity=75);-moz-opacity:.75;opacity:.75;”><img src=”http://www.computereducationworld.com/images/v90.gif” width=”50″ height=”50″></span> <span style=”float:left;filter:alpha(opacity=100);-moz-opacity:1.0;opacity:1.0;”><img src=”http://www.computereducationworld.com/images/v90.gif” width=”50″ height=”50″></span> </div> Opacity Over Easy.This is the easy way to hover with opacity. The opacity is all in CSS. The onmouseover isn’t needed and there is only one image. <style type=”text/css”> a.linkopacity:hover img { |
| « CSS Pseudo-classes | CSS Media Type » |
| Posted on Friday, June 27th, 2008 at 3:55 pm under Basic of Computers | RSS 2.0 Feed | |