1、网页设计中怎么让一张图片填充满整个画面 求代码
1、如果楼主只是将其当做一张图片显示,可以通过css控制,如img{width:100%;height:100%;}.
否则需要将其作为网页背景的话可以试试如下方法:
2、如果这张图片为背景图片由于背景图片不具有伸缩性,只能通过别的方法绕着解决,在ie中可以用<body
style="filter:progid:dximagetransform.microsoft.alphaimageloader(src='1.jpg',sizingmethod='scale')">,实现背景拉伸铺满整个浏览器,但其它的浏览器不支持。
这时可以拐个弯,设置两层div,底层div当做背景使用,放置一张图片即可。
<div id="background" style="position:absolute;z-index:-1;width:100%;height:100%;top:0px;left:0px;"><img src="1.jpg" width="100%" height="100%"/></div>
再将网页内容放置到第二层上<div id="content">页面内容</content>
3、网页背景图片默认情况下是重复平铺满整个页面。上面2方法是要求图片不重复,但又得占满浏览器所采用的方法。
2、制作网页怎么添加图片?〈用HTML语言〉
你说的是背景样式吧? HTML代码: <body background="图片路径"> CSS样式代码: <style type="text/css"> body{ background:url("图片路径"); } </style> 记得:图片路径最好不要采用中文,可能有些浏览器对中文路径支持不好。
3、html网页设计里面怎么平铺背景图片
html网页设计里面平铺背景图片的代码如下:
<html>
<body>
<div id="Layer1" style="position:absolute; left:0px; top:0px; width:100%; height:100%">
<img src="pictures/background.jpg" width="100%" height="100%"/>
</div>
</body>
</html>
网页背景默认是平铺整个屏幕的,可能有以下原因导致不能平铺:
1、图片不够大,又background属性不能拉伸图片;
2、只能用个div,把其z-index值设为负,并使这个div大小为整个body大小,在div里用<img> ;
3、body的background属性去掉,要不然会被遮住。
4、网页设计怎样添加图片
网页设计如何插入图片?以下就是网页设计如何插入图片等等的介绍,希望为您带来帮助。
第一步,先打开我们的网页制作如见,目前比较常用的是Dreamweaver。选择"HTML"。
第二步,打开这个软件之后,我们可以看到左上角有三个选项,我们选择其中的“设计”。
第三步,来到设计界面之后,把光标定位在自己要插入图片的位置。
这个操作是不用写代码的,所以可以选择工具栏上的“插入”命令。
接下来,我们在弹出的下拉菜单中选择插入图像命令。
选择完插入图像命令之后,会弹出这样一个小窗口,我们把要插入的图片的文件名输入进去之后再点击确定就可以了。
做完上面这一切步骤之后,图片就可以插入到网页中了,大家可以预览网页哦!
5、网页制作中,如何用html代码实现有图片就显示图片,没图片就不显示
我明白你的意思。思路如下
查找第一个<img 标签及之后的第一个>中的内容 再提取src=到第一个空格的内容就是你要的图片地址,如果为空 你知道的
不过一般是在数据库的表里多建一个项,在提交内容的时候就会将这个保存到数据库里。要不没次访问的时候都做一次运算增加负担。
6、网页设计DW 怎么添加背景图片代码是多少
不知道你的意思是哪种的背景图片!
1.假如是整张网页的背景图片的话,就是写body的css样式 也就是
body { background: url("图片的地址")}2.一般的假如图片的话
<img src="图片的地址">3.一般div块的地址
7、html网页制作中,把图片放在左下方怎么做
用嵌套的div来相对定位:
<div id="beijing" style="background-image:url(image/bg/nav_blue.gif); width:400px; height:200px;"><div style="margin-left:100px; margin-top:50px; border:#F00 solid 1px; width:80px; height:40px;"></div></div>
上面是个例子
下面的代码解释 :
margin-left:100px;就是距离背景层版左边的距离为权100像素,
margin-top:50px; 就是距离背景层上边的距离为50像素;
如果你想把图放到左下方的地方,
就用margin-left:100px;
右边的话就用margin-right:100px;
代码第一行打括号的地方就是放图片链接的
自己拿去再稍加琢磨,应该很快就可以搞定了!
htm代码其实很容易懂的!
祝你成功吧
8、怎么给图片制作带链接的网页HTML代码?
<img src='这里是图片地址' >
<a href="链接到的地址"></a> a这个标签是个超链接包着图片
写法:<a href="链接到的地址"><img src='这里是图片地址' ></a>
9、网页制作是如何实现图片切换的?
新建项目文件夹如下图所示

编写index.html文件,代码如下:
<DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>
lunbo
</title>
<link href="css/style.css" rel="stylesheet"/>
<script src="js/lunbo.js">
</script>
</head>
<body>
<div id="container">
<div id="list" style="left:-600px;">
<img src="images/5.jpg" alt="5.pg"/>
<img src="images/1.jpg" alt="5.pg"/>
<img src="images/2.jpg" alt="5.pg"/>
<img src="images/3.jpg" alt="5.pg"/>
<img src="images/4.jpg" alt="5.pg"/>
<img src="images/5.jpg" alt="5.pg"/>
<img src="images/1.jpg" alt="5.pg"/>
</div>
<div id="buttons">
<span index="1"class="on"> </span>
<span index="2"></span>
<span index="3"></span>
<span index="4"></span>
<span index="5"></span>
</div>
<a href="javascript:;" class="arrow" id="prev"><</a>
<a href="javascript:;" class="arrow" id="next">></a>
</div>
</body>
</html>

编写style.css文件,代码如下:
*{ margin:0px; text-decoration:none;}
body{margin-top:50px;}
#container{width:600px; height:400px; position:relative;border:3px solid #333;overflow: hidden; margin:0 auto;}
#list{width:4200px; height:400px; position:absolute; z-index:1;}
#list img{float:left;}
#buttons{position:absolute; height:10px; width:100px; z-index:2; bottom:20px; left:250px;}
#buttons span{cursor:pointer;/*假超链接样式*/ float:left; border:1px solid #fff; width:10px; height:10px; border-radius:10px; background:#333; margin-right:5px;}
#buttons .on{background:orangered;}
.arrow{cursor:pointer; display:none; line-height:39px; text-align:center; font-size:36px;
font-weight:bold; width:40px; height:40px; position:absolute; z-index:2; top:180px;
background-color: RGBA(0,0,0,.3); color:#fff;}
.arrow:hover{background-color:RGBA(0,0,0,.7);}
#container:hover .arrow{display:block;}
#prev{left:20px;}
#next{right:20px;}

编写control.js文件代码如下
window.onload=function(){
var container=document.getElementById('container');
var list=document.getElementById('list');
var buttons=document.getElementById('buttons').getElementsByTagName('span');
var pre=document.getElementById('prev');
var next=document.getElementById('next');
var index=1;
var animated=false;
var timer;
function showButton(){
for(var i=0;i<buttons.length;i++){
if(buttons[i].className=='on'){
buttons[i].className='';
break;
}
}
buttons[index-1].className="on";
}
function animate(offset){
animated=true;
var newleft=parseInt(list.style.left)+offset;
var time=300;//位移总时间
var interval=10;//位移间隔时间
var speed=offset/(time/interval);//每一次的位移量
function go(){
if((speed<0&&parseInt(list.style.left)>newleft)||(speed>0&&parseInt(list.style. left)<newleft)){
list.style.left=parseInt(list.style.left)+speed+'px';
setTimeout(go,interval);
}
else{
animated=false;
list.style.left=newleft+'px';
if(newleft>-600){
list.style.left=-3000+'px';
}
if(newleft<-3000){
list.style.left=-600+'px';
}
}
}
go();
}
function play(){
timer=setInterval(function(){
next.onclick();
},3000);
}
function stop(){
clearInterval(timer);
}
next.onclick=function(){
if(index==5){
index=1;
}
else{
index+=1;
}
showButton();
if(animated==false){
animate(-600);
}
}
pre.onclick=function(){
if(index==1){
index=5;
}
else{
index-=1;
}
showButton();
if(animated==false){
animate(600);
}
}
for(var i=0;i<buttons.length;i++){
buttons[i].onclick=function(){
if(this.className=='on'){
return;
}
var myIndex=parseInt(this.getAttribute('index'));
var offset=-600*(myIndex-index);
index=myIndex;
showButton();
if(animated==false){
animate(offset);
}
}
}
container.onmouseover=stop;
container.onmouseout=play;
play();
}

images文件的图片截图如下

运行效果截图如下:

10、网页制作中使整个网页背景为一个颜色或一张图片的代码怎么写?
设置背景色<body style="background:#CC9999">
</body>
设置背景图片<body style="background-image:url(图片地址)">
</body>