HTML能否把背景图改成透明的?

来源:百度知道 编辑:UC知道 时间:2024/06/14 23:32:59
以下是百度知道里一个朋友帮我编写的一份等于是记录妻子怀孕天数的HTML..保存为HTML文件后,在桌面WEB里设置显示到桌面上..但是背景图案是黑色的..所以现在只能用黑色的桌面图来衬托它..求教高手,能否把它改透明背景,以便我能更换别的桌面图片.谢谢

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>cha0</title>
</head>

<body bgcolor="#000000">

<FONT style="FONT-SIZE: 15pt; FILTER: shadow(color=#255,strength=8); WIDTH: 100%; COLOR: #D5E7F5; LINE-HEIGHT:160%; FONT-FAMILY: 华康少女文字W5(P)">
今天是
<script language=JavaScript>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"

<body bgcolor="#000000">改成

<body background="c:\aaa.jpg">
就可以了
c:\aaa.jpg可以替换成你想要的图片路径

第一张图,background="d:\my documents\my pictures\1.jpg",不是background"d:\my documents\my pictures\1.jpg" 少个等号

第二次,background:url(d:\my documents\my pictures\1.jpg)",不是background:url(d:\my documents\my pictures\1.jpg"",最后多个引号少个括号

顺便说一下我们这两种做法的原理都是用一张你想要做桌面背景的图来当html的背景,不是把Html变透明,html的背景是无法透明的,因此这个1.jpg就应该是整个桌面背景图了,不能在桌面上挖出一块说这里放个html还要他背景透明

你在这代码里面把你要的背景图片写进去
把<body bgcolor="#000000">改成<body style="background:url(你的背景图片地址)">

<body style="background:url(D:\a.jpg)">
---------------------------------------
<body style="background:url(D:\a.jpg)">
这里面的background:url(D:\a.jpg)是路径啊,
请把D:\a.jpg改为你自己电脑上的图片路径,或者网络上的路径