The range of values for the opacityproperty is 0.0 to 1.0. The more transparent, the lower the value:
Example
img {
opacity: 0.5;
}
Image Text
How to arrange text within a picture:
Image Filters
An element can have visual effects (such saturation and blur) added to it using the CSS filter property.
Note: Neither Edge 12 nor Internet Explorer implement the filter property.
Example
Make all of the images 100% grayscale and black and white:
img {
filter: grayscale(100%);
}
An element can have visual effects (such saturation and blur) added to it using the CSS filter property.
Note: Neither Edge 12 nor Internet Explorer implement the filter property.
------IMAGE MUKAVI-------
Image Hover Overlay
Construct a hovering overlay effect:
-------Example MUKAVA------
Flip an Image
Drag the mouse pointer over the image:
------ ANIMATION PHOTO MUKAVU--------
Example
img:hover {
transform: scaleX(-1);
}
Responsive Image Gallery
Image galleries can be made with CSS. In this example, the photos are rearranged on various screen sizes using media queries. To observe the effect, resize the browser window:
------ ANIMATION PHOTO MUKAVU--------
Example
.responsive {
padding: 0 6px;
float: left;
width: 24.99999%;
}
@media only screen and (max-width: 700px){
.responsive {
width: 49.99999%;
margin: 6px 0;
}
}
@media only screen and (max-width: 500px){
.responsive {
width: 100%;
}
}
Image Modal (Advanced)
This is an illustration of how JavaScript and CSS may cooperate.
First, make a dialog box (modal window) with CSS and set its default hiding behavior.
Next, when a user clicks on the image, use JavaScript to show the modal window and display the image inside of it:
------ ANIMATION PHOTO MUKAVU--------
Example
// Get the modal
var modal = document.getElementById('myModal');
// Get the image and insert it inside the modal - use its "alt" text as a caption
var img = document.getElementById('myImg');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
captionText.innerHTML = this.alt;
}
// Get the element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}