Home Web Front-end CSS Tutorial 'CSS3 Practical Combat' Notes--Gradient Design (3)

'CSS3 Practical Combat' Notes--Gradient Design (3)

Dec 20, 2016 pm 02:36 PM

IE browser engine CSS gradient implementation method

IE does not support CSS gradients, but it provides gradient filters that can be used to achieve simple gradient effects.

Basic syntax

The parameter description of this parameter is as follows:

enabled: Set or retrieve whether the filter is activated. Optional Boolean value, including true and false, default value is true , indicating activation status.

startColor: Set or retrieve the starting color and transparency of the color gradient. Optional in the format #AARRGGBB. AA, RR, GG, and BB are hexadecimal positive integers, and the value range is 00~FF. RR specifies the red value, GG specifies the green value, BB specifies the blue value, AA specifies the transparency, 00 is completely transparent, and FF is completely opaque. Values ​​outside the value range will be restored to the default value. The value range is #FF0000~#FFFFFF, and the default value is #FF0000FF, which is opaque blue.

EndColorStr: Set or retrieve the end color and transparency of the color gradient. The default value is #FF000000, which is opaque black.

Practical application of IE gradient filter

Use IE filter to design a gradient background, and then use the background image to design graphic and text illustration effects.

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>IE浏览器引擎的CSS渐变实现方法</title>
<style type="text/css">
body {
 padding:1em;/让渐变背景填充整个页面/
 margin:0;
 text-align:center;
 /*为网页设计垂直渐变背景*/
 filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0, startColorStr=#9999FF, endColorStr=#ffffff);
}
h1 {/*标题样式*/
 color:white;
 font-size:18px;
 height:45px;
 line-height:65px;/*控制文本显示位置*/
 /*以绝地定位方式实现块元素居中显示*/
 position:absolute;
 left:50%;
 margin-left:-150px;
 padding-left:50px;
 border-bottom:solid 2px #c72223;
 /*为标题插入一个装饰图标*/
 background:url(images/icon4.png) no-repeat left center;
}
ul {/*列表框样式*/
 /*清除列表默认样式*/
 list-style-type:none;
 margin:90px 0 0 0;
 padding:0;
 background:url(images/bg6.png) no-repeat right bottom;/*设计插图背景*/
 clear:both;
 text-align:left;/*恢复默认对齐方式*/
}
li {
 line-height:1.5em;
 margin:6px auto;
 /*为列表项设计个性化的列表图标*/
 font-size:14px;
 background:url(images/icon3.png) no-repeat left 3px;
 padding-left:20px;
}
</style>
</head>
 
<body>
<h1>喜欢是一种心情,爱是一种感受</h1>
<ul>
 <li>有一种爱叫痴缠,比如很多人对张国荣的,有时候这样真的挺好,没有比爱一个故人更安全和永恒的了。</li>
 <li>有一种爱叫迷恋,某一时间里,忽然发现自己迷上某个人或某种感觉,但那不会长久。有时候迷恋会转化成爱。</li>
 <li>爱里面一定有迷恋、有喜欢。可迷恋、喜欢都不是爱。</li>
 <li>当自己终于明白什么是爱的时候,往往生命去了大半。人生路上能遇上一个真正爱自己的人,是机缘。</li>
 <li>有时候,爱是一瞬间的感觉,爱并不能长久保留,如果两人经营得好才会长久保留下去。爱同时是脆弱的,爱会破碎。</li>
 <li>有时候,爱是一种心愿,一种可以让自己与对方更快乐的心情。一份美好的爱必定离不开包容。</li>
 <li>有时候,爱是一种自然。花开花落,云卷云舒的一点没有强求。</li>
 <li>当能够以一种平淡的心情看待感情时,爱便变得隽永。</li>
 <li>爱情有时候让人变得很苛刻,但后来又会很包容。当爱对方超过爱自己,那爱就会很包容。</li>
 <li>喜欢一个人不会对他很苛刻,因为喜欢不会有更多的要求。相反爱却是苛刻的。</li>
 <li>喜欢一个人不会为她很心痛,爱却往往是很心痛。爱是一种归属,喜欢没有归属。</li>
 <li>在喜欢与爱的边缘徘徊的人,如果尝试着离开很远,还能在某个深夜静静地想起他,想到心痛与流泪,那一定是爱了。</li>
 <li>在爱上之前可能有很长的喜欢,有时喜欢就能转化成爱,有时喜欢也会淡掉。原来人与人都是平行线上的一些点,檫肩而过很平常,向左转,向右转,下一个路口,还会有新的风景。</li>
 <li>有时候喜欢会带来遗憾,但爱情会带来伤害。这种伤害最后会变成对对方一生的祝福。但喜欢就会越来越淡,最后在心里留下一个淡漠的影子。爱比喜欢要有力量。</li>
</ul>
</body>
</html>
Copy after login


For more "CSS3 Practical Combat" notes - Gradient Design (3), please pay attention to the PHP Chinese website for related articles!

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Working With GraphQL Caching Working With GraphQL Caching Mar 19, 2025 am 09:36 AM

If you’ve recently started working with GraphQL, or reviewed its pros and cons, you’ve no doubt heard things like “GraphQL doesn’t support caching” or

Making Your First Custom Svelte Transition Making Your First Custom Svelte Transition Mar 15, 2025 am 11:08 AM

The Svelte transition API provides a way to animate components when they enter or leave the document, including custom Svelte transitions.

Show, Don't Tell Show, Don't Tell Mar 16, 2025 am 11:49 AM

How much time do you spend designing the content presentation for your websites? When you write a new blog post or create a new page, are you thinking about

Building an Ethereum app using Redwood.js and Fauna Building an Ethereum app using Redwood.js and Fauna Mar 28, 2025 am 09:18 AM

With the recent climb of Bitcoin’s price over 20k $USD, and to it recently breaking 30k, I thought it’s worth taking a deep dive back into creating Ethereum

How do you use CSS to create text effects, such as text shadows and gradients? How do you use CSS to create text effects, such as text shadows and gradients? Mar 14, 2025 am 11:10 AM

The article discusses using CSS for text effects like shadows and gradients, optimizing them for performance, and enhancing user experience. It also lists resources for beginners.(159 characters)

What the Heck Are npm Commands? What the Heck Are npm Commands? Mar 15, 2025 am 11:36 AM

npm commands run various tasks for you, either as a one-off or a continuously running process for things like starting a server or compiling code.

Creating Your Own Bragdoc With Eleventy Creating Your Own Bragdoc With Eleventy Mar 18, 2025 am 11:23 AM

No matter what stage you’re at as a developer, the tasks we complete—whether big or small—make a huge impact in our personal and professional growth.

Let's use (X, X, X, X) for talking about specificity Let's use (X, X, X, X) for talking about specificity Mar 24, 2025 am 10:37 AM

I was just chatting with Eric Meyer the other day and I remembered an Eric Meyer story from my formative years. I wrote a blog post about CSS specificity, and

See all articles