Home Web Front-end CSS Tutorial Introduction to the difference between background and _background in css attributes

Introduction to the difference between background and _background in css attributes

Jul 21, 2017 am 09:12 AM
background css

css样式表中有如下语句:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

.imminbox {

width:39px;

height:29px;

padding-right:3px;

cursor:pointer;

position:absolute ;

right:1px;

bottom:0px;z-index:20;

overflow: visible;

background:url(../images/im_minbar.png)

no-repeat;

_background:url(../images/im_minbar.gif)

no-repeat; top:auto;

}

Copy after login

不知道_background属性应该如何理解

1

2

3

4

5

6

7

*html .imbox{

position:absolute;

bottom:auto;

top:expression(eval(document.documentElement.

scrollTop+document.documentElement.

clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))-35);

}

Copy after login

css中有这么一句,“*html”是什么意思,怎么理解呀?

1,_background 是IE6的hank 属性, 在样式属性前加“ _ ” 只有ie6能识别;样式从向往下运行,一直运行到不能执行为止.

比如

1

2

3

4

5

6

7

style{

 color:#000000;                  /* FF,OP支持 */

 color:#0000FF\9;       /* 所有浏览器IE浏览器(ie6+)支持 ;但是IE8不能识别“*”和“_”的css hack;所以我们可以这样写hack */

 [color:#000000;color:#00FF00;      /* SF,CH支持 */

 *color:#FFFF00;                 /* IE7支持 */

 _color:#FF0000;                 /* IE6支持 */

}

Copy after login

2,关于*html .imbox  
也是属于ie 6 的hank . 为能解决ie 6的特定问题而设置的。

*html 是表示IE6的hack写法,等同于上面的_background:url(...)中用到的“_属性”。

这种属性通常接在正常属性后面,比如.class{ background:blue; _background:red;},意思即是除IE6背景色都是蓝色,IE6背景色则是红色。换成*html的写法便是: .class { background:blue; } *html .class{ background:red },都是一个效果。

这是考虑到不同版本IE的问题,_background这个属性是只对IE6起效!因为IE6对png的透明属性不支持!所以当用户浏览器是IE6的时候就会自动使用_background这个样式!你没看到背景图片是gif格式的嘛

The above is the detailed content of Introduction to the difference between background and _background in css attributes. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1653
14
PHP Tutorial
1251
29
C# Tutorial
1224
24
How to use bootstrap in vue How to use bootstrap in vue Apr 07, 2025 pm 11:33 PM

Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

How to write split lines on bootstrap How to write split lines on bootstrap Apr 07, 2025 pm 03:12 PM

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

How to insert pictures on bootstrap How to insert pictures on bootstrap Apr 07, 2025 pm 03:30 PM

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

How to use bootstrap button How to use bootstrap button Apr 07, 2025 pm 03:09 PM

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

How to set up the framework for bootstrap How to set up the framework for bootstrap Apr 07, 2025 pm 03:27 PM

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

How to resize bootstrap How to resize bootstrap Apr 07, 2025 pm 03:18 PM

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

See all articles