<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">.box{position:relative;}.bg{position:absolute; left:5px; top:5px; z-index:-1; font-size:12px;}input{ height:20px; background-color:transparent; border: 1px solid #F00;}</style></head><body><div class="box"><span onClick="alert('我是背景')" class="bg">文明扯淡,利国利民。</span><input type="text" /></div></body></html>
当一个input框背景透明时(background-color:transparent;),在ie下会被穿透,而在chrome等浏览器下则不会,有什么方法可以解决?
回复讨论(解决方案)
有人知道吗?
可以用半透明的图片作为input的背景,而不是用文字,就可以解决
可以用半透明的图片作为input的背景,而不是用文字,就可以解决
+1
或者试试滤镜吧
把input中的背景图片设置成和div的背景图片相同的即可
引用 2 楼 jellday 的回复:
可以用半透明的图片作为input的背景,而不是用文字,就可以解决
+1
或者试试滤镜吧
试过滤镜,半透明和渐变,都是穿透。
可以用半透明的图片作为input的背景,而不是用文字,就可以解决
你说的是可以的,用一像素半透明png,不过这个方案,不能用css图片拼合,在ie6也不给力。所以我想有没有滤镜还是什么,可以不穿透的。
可以用半透明的图片作为input的背景,而不是用文字,就可以解决
把文字写进图片,用图片做背景,不是很ok,因为那文字随时会变,不能重用。你可以参考下mail.qq.com,他们在ie下,背景也是穿透的,他们的方案是点击到背景文字时候,再fouse到上面的输入框。
我解决办法很简单:给input加上属性:
background:url(0) no-repeat;
兼容所有浏览器,呵呵!
很好很好给力
我解决办法很简单:给input加上属性:
CSS code1background:url(0) no-repeat;
兼容所有浏览器,呵呵!
不错,我的问题解决了
LZ你是我的神啊,帮我解决大问题了!

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 <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

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 <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


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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver CS6
Visual web development tools

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