Hot File

Create mirror image (Image Reflection) with CSS3 simple

View: 2727    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: References   Fields: Other

9 point/5 review File has been tested

In previous articles, we've talked a lot about the new properties that CSS3 brings. However, there are a few properties that we have yet to learn, although it is also very interesting. One of them is the box-reflect properties, whose primary function is to create the reflection of an object.

Introduction

In previous articles, we've talked a lot about the new properties that CSS3 brings. However, there are a few properties that we have yet to learn, although it is also very interesting. One of them is the box-reflect properties, whose primary function is to create the reflection of an object.

Tạo ảnh phản chiếu (Image Reflection) với CSS3

Create a basic reflection:

Suppose we need to create a reflection beneath the object, we use the following:

1
2
3
img {
    -webkit-box-reflect: below;
}

Tạo ảnh phản chiếu (Image Reflection) với CSS3

In this example, we create reflection right underneath the object, you want to, you can create reflections on the left, right or even above the object with the values right, left and above .

Value Offset

Offset is the value used to create distance between the object and its reflection. Let's see the following css:

1
2
3
img {
    -webkit-box-reflect: below 10px;
}

In the code above, we share a reflection of the object with a distance of 10px.

Tạo ảnh phản chiếu (Image Reflection) với CSS3

Reflection that we do just now looks still not considering the fact, so we will apply more CSS3 Gradients to make it look more realistic.

1
-webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottombottom, from(transparent), to(rgba(250, 250, 250, 0.1)));

Css paragraph above will produce results like this:

Tạo ảnh phản chiếu (Image Reflection) với CSS3

We can also use color-stop to look better reflection:

1
2
3
img {
    -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottombottom, from(transparent), color-stop(70%, transparent) , to(rgba(250, 250, 250, 0.1)));
}

Tạo ảnh phản chiếu (Image Reflection) với CSS3

Alternatives for Firefox

Unfortunately for us, at this moment, imaging reflective properties can only run on Webkit browsers (Safari and Chrome ie). Thus to make reflections run on Firefox, we need to use -moz-element ().
Suppose we have an image within the <div> with id is -moz-reflect

1
2
3
<div id="moz-reflect">
    <img src="images/everything_matters.large.jpg">
</div>

and create reflections, we use: after pseudo-element is shown below:

1
2
3
4
5
6
7
8
9
#moz-reflect:after {
    content: "";
    display: block;
    background: -moz-element(#moz-reflect) no-repeat;
    width: auto;
    height: 375px;
    margin-bottom: 100px;
    -moz-transform: scaleY(-1);
}

However, it can only be like this:

Tạo ảnh phản chiếu (Image Reflection) với CSS3

I hope this short article will help you get more experience as well as knowledge of CSS3.

Good luck!

Create mirror image (Image Reflection) with CSS3 simple

Create mirror image (Image Reflection) with CSS3 simple Posted on 15-08-2015  In previous articles, we've talked a lot about the new properties that CSS3 brings. However, there are a few properties that we have yet to learn, although it is also very interesting. One of them is the box-reflect properties, whose primary function is to create the reflection of an object. 1.8/10 2727

Comment:

To comment you must be logged in members.

Files with category

  • Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    View: 2535    Download: 0   Comment: 0   Author: none  

    Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    Category: References
    Fields: Other

    0/2 review
    Windows 10 pre-installed Mail application for managing personal email on the device. The latest version of this application but improved a lot and support other email accounts such as Gmail or Yahoo Mail but users almost no "salty" really with this...

  • Step by step instructions to create social networking buttons with CSS3

    View: 1840    Download: 0   Comment: 0   Author: none  

    Step by step instructions to create social networking buttons with CSS3

    Category: References
    Fields: Other

    0.75/6 review
    CSS3 help web designers have the ability to create buttons (buttons) very nice, today I will share with you two tips decoration for button in your web becomes radiant beauty that no need to use photoshop.

  • You should understand the CSS Box Shadow

    View: 1998    Download: 0   Comment: 0   Author: none  

    You should understand the CSS Box Shadow

    Category: References
    Fields: Other

    1.3181818181818/11 review
    Effects his shadow was introduced in the previous article, however, in this article, I will guide more specific about shadow attributes, you try it with anything. First we try to learn css following paragraph:

  • How to do button movement with beautiful CSS3

    View: 1671    Download: 0   Comment: 0   Author: none  

    How to do button movement with beautiful CSS3

    Category: References
    Fields: Other

    0/4 review
    Previously to create motion effects button, you must draw the button in photoshop, then switched to flash to make it possible to move. But now you need not spend too much time doing it, all because of the emergence of CSS3.

  • Create a dropdown menu with CSS3 effects with beautiful transtions

    View: 1962    Download: 0   Comment: 0   Author: none  

    Create a dropdown menu with CSS3 effects with beautiful transtions

    Category: References
    Fields: Other

    0.45/10 review
    More of the dropdown menu you want to introduce to you, this will have the effect menu transitions (converted background of menu background from pale to dark). This menu works well on browsers like FF, Chrome, Safary, but unfortunately did not work...

  • How to hack css for all browsers you should know

    View: 1590    Download: 0   Comment: 0   Author: none  

    How to hack css for all browsers you should know

    Category: References
    Fields: Other

    1.6875/8 review
    In the process of web design, which makes it the most headaches is how to design web pages that you can run on the browser. Especially when clients use the old as IE6 browser such. However, with this article, you will easily edit interface runs well...

  • Create Accordion with extremely beautiful CSS3

    View: 1982    Download: 0   Comment: 0   Author: none  

    Create Accordion with extremely beautiful CSS3

    Category: References
    Fields: Other

    0.9/5 review
    Accordion is a technique that helps you shortened the content that you want displayed on the website. It is often used for the display of submenus. In addition you can also use it for content, images. Before applying this procedure, you have to use...

  • Create the effect Hovercho images with Webkit and CSS3 is great

    View: 1690    Download: 0   Comment: 0   Author: none  

    Create the effect Hovercho images with Webkit and CSS3 is great

    Category: References
    Fields: Other

    1.125/4 review
    WebKit is one open source application framework provides the necessary components built one for your web browser. Along with CSS3, cả have contributed to very nice effect những previously only using JavaScript or JQuery thực beige.​

 
Newsletter Email

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd