Hello friends how are you , Today in this post "Off On Light Effect in HTML and CSS" i am going to teach you how you can create an OFF and ON light effect in HTML using very simple lines of HTML and CSS code. If you wan to create something interesting using simple HTML and CSS then this post is for you.
If you want to understand this through video then watch this video i have explained it step by step live
Now i am going to explain step by step.
Step 1:Create a Folder: Just create a folder with any name and in any drive in your system, In my case my folder name is myhtml.
Step 2:Create an HTML file: Now open notepad and type the below code or you can copy this code for your personal use
Now save this file with name light.html inside the created folder [myhtml]. Note:Don't forget to type .html after the file name because .html is the extension for HTML file.
Step 3:Download and store images: First click here to download images. When you will download it then you will get both images for off and on in a single image so first crop the images one by one then store these images into the folder myhtml.
After doing these your created folder will look like below.
Step 4:Run HTML file: Now its time to run HTML file so right click on light html file and then select open with and then select chrome browser or you can select any browser for output.
You will get output screen like below screenshot.
Now when you will move mouse on this bulb you will notice some lighting effect like below screenshot. For better experience and live result see the above video.
I hope now you can create "Off On Light Effect in HTML and CSS". If you have any doubt regarding this post or you want something more in this post then let me know by comment below i will work on it definitely.
0 Comments