如何设置背景图片全屏?

LoginOut 2010-04-09 12:09:54

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>mspaint.html</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
body{
background:url('image/xdbg.jpg');
width:100%;
height:100%;
}
</style>
</head>

<body>

</body>
</html>



现在有一个问题是,全屏是全屏了,但是效果是拼出来的,图片小,浏览器窗口大
如何让它填充整个页面
...全文
4838 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
didiself 2012-05-09
  • 打赏
  • 举报
回复
repeat?
chenjwjw 2012-05-08
  • 打赏
  • 举报
回复
添加样式:background-size:cover;ie8.0及以下不支持该样式,其它浏览器都支持!
xinguanjiang 2012-05-08
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 的回复:]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>mspaint.html</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-eq……
[/Quote]
全屏是全屏了,东西不能点了
KK3K2005 2012-04-24
  • 打赏
  • 举报
回复


在背景图片不能拉伸的 浏览器中
使用:1)纯色 + 图片的设置 2)平铺图片

1)图片和纯色要自然融合 没有边界感
missgd152 2012-04-24
  • 打赏
  • 举报
回复
设置背景图片,如果图片小,没设置repeat:no-repeat,那就是楼主说的拼出来的效果了;如果图片够大一放上去就是全屏效果了,设置一下repeat:no-repeat。
JPF1024 2012-04-23
  • 打赏
  • 举报
回复
js比css加载慢...
glwolf111 2012-04-23
  • 打赏
  • 举报
回复
7楼正解,请问filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image/xdbg.jpg', sizingMethod='scale');这句代表什么意思啊????
flyxiao1987 2010-04-29
  • 打赏
  • 举报
回复
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>mspaint.html</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
body{
background:url('image/xdbg.jpg');
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image/xdbg.jpg', sizingMethod='scale');
width:100%;
height:100%;
}
</style>
</head>

<body>

</body>
</html>
passself 2010-04-29
  • 打赏
  • 举报
回复
当然用js也可以实现的啊,css的一切效果,都可以用js来动态完成
ljtxcc 2010-04-28
  • 打赏
  • 举报
回复
不用CSS可以实现不 ?
真哥哥 2010-04-09
  • 打赏
  • 举报
回复
孟子E章...

孟子E章 2010-04-09
  • 打赏
  • 举报
回复
CSS3

http://dotnet.aspx.cc/article/ac7f6f17-cc42-4b26-9e00-31d5f4671417/read.aspx
adela_hui 2010-04-09
  • 打赏
  • 举报
回复
这种背景图片一般是渐变的
在css文件内定义
url(images/Bg.jpg) #edf6fb repeat-x 0px 0px;

padding表示空白,可以设置为0 repeat-x 表示横向和纵向平铺

tian80678765 2010-04-09
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>

<body onLoad="DoInit()">
<object id="MaxButton" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Maximize">
</object>
<script language="JavaScript">
function DoInit(){
if (document.body.offsetWidth!=screen.availWidth)
MaxButton.Click()
}
</script>
</body>
</html>
看看修改一下可以不,这个是让网页全屏的例子

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧