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>