示例1。首先我们先看一张多个图片拼接成的合成图,我们要取其中的一个图标
我们取这个第二个图标
<html><meta http-equiv="Content-Type" content="text/html"; charset="UTF-8"/><style>.sk_background_1{height: 46px;width: 41px;//background url(xx.jpg) left top;background : url(img/css-sprites-01.gif) 231px -60px ;}</style><div class="sk_img"><div class="sk_background_1">这里有张图片</div></div></html>
关键代码也就是
height: 46px;width: 41px;//高度和宽度是显示图片的大小。url后面的2个坐标,第一个是距离浏览器的左边据,第二个是距离浏览器的上边距,如果左边,上边有其他标签。这个坐标就是以最近的标签为0开始计算background : url(img/css-sprites-01.gif) 231px -60px ;
示例2,显示3个按钮,按纽可以点击。
<html><meta http-equiv="Content-Type" content="text/html"; charset="UTF-8"/><script></script> <style>.sk_img ul li{margin: 0;padding: 0;list-style: none;top: o;}.sk_img_button1{width: 84px;height: 85px;background : url(img/css-sprites-02.jpg) -208px 97px;}.sk_img_button2{width: 84px;height: 85px;background : url(img/css-sprites-02.jpg) 294px -30px;}.sk_img_button3{width: 84px;height: 85px;background : url(img/css-sprites-02.jpg) 205px -31px ;}</style> <div class="sk_img"><ul><a href="window.history.back(-1);"><li class="sk_img_button1"></li></a><a href="https://www.baidu.com"><li class="sk_img_button2"></li></a><a href="https://www.163.com"><li class="sk_img_button3"></li></a></ul></div></html>
点击按纽则跳转,点击第一个返回上一个页面,点击第二个调转到baidu等。

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
