CSS image splicing technology 1. Image stitching
With CSS styles, we can display the part of the image we need The detailed code is as follows: <!doctype html> <html> <head> <meta charset="utf-8"/> <title>Image Integration</title> <style> .box{ width:200px; margin:0 auto; overflow:hidden; } .iton{ width:43px; margin-left:10px; height:44px; float:left; background:url(images/img_navsprites_hover.gif) no-repeat; } .span01{ background-position:0 0; } .span02{ background-position:-47px 0; } .span03{ background-position:-91px 0; } .span01:hover{ background-position:0 -45px ; } .span02:hover{ background-position:-47px -45px ; } .span03:hover{ background-position:-91px -45px ; } </style> </head> <body <div class="box"> <span class="iton span01"></span> <span class="iton span02"></span> <span class="iton span03"></span> </div> <body> </html> The running results are as follows: This effect adds a floating style when the mouse hovers over the element, and sets the background-position to change the position of the image to continuously update. Welcome to give your advice! The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: W3C Tutorial (5): W3C XML Activities
>>: How to implement batch deletion of large amounts of data in MySQL large tables
<div id="root"> <h2>Keep go...
There are two common ways to make div background ...
symptom I set a crontab task on a centos7 host, b...
This article shares the specific code of JavaScri...
Preface Hello everyone, I am Liang Xu. At work, w...
HTML web page list tag learning tutorial. In HTML ...
Table of contents 1. querySelector queries a sing...
<br />For every ten thousand people who answ...
Preface Not long ago, I combined browser-sync+gul...
Preface Sometimes I feel that the native UI of We...
Table of contents Boot Options Command Line Long ...
MySQL regular sorting, custom sorting, and sortin...
1. Set a directory whitelist: Do not set restrict...
When it comes to tool-type websites, we first hav...
Table of contents When to use Structural branches...