css图片html标签选中问题求解决

html-css017

css图片html标签选中问题求解决,第1张

试试这个

-moz-user-select: none

-webkit-user-select: none

-ms-user-select: none

-khtml-user-select: none

user-select: none

用background-position: 给背景定位

.img{ background-image:url(bj.jpg)width:79px height:30background-position: 00}显示绿色背景

.img{ background-image:url(bj.jpg)width:79px height:30background-position: 0 30}显示黄色背景

下面这样做应该可以吧

-------------------------------————————————————————————

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312">

<title>无标题文档</title>

<style type="text/css">

<!--

body,td,th {

font-size: 12px

}

.img{ background-image:url(bj.jpg)width:79px height:30}

.01{background-position: 0 0}

.02{background-position: 0 30}

-->

</style></head>

<body>

<div class="img 01"></div>

<div class="img 02"></div>

</body>

</html>