發新話題

HTML的背景語法

HTML的背景語法

引用:
◎怎樣才能只移動字而背景不會動?
請將語法複製後,貼在<head>.......</head>之間即可。

1.背景單張固定(右下)---------------------------------------------------------

<style type=text/css>
<!--
body{
background-image : url(圖片位址);
background-repeat : no-repeat;
background-attachment : fixed;
background-position : 100% 100%;
}
-->
</style>


2.背景單張固定(置中)---------------------------------------------------------

<style type=text/css>
<!--
body{
background-image : url(bg.gif);
background-repeat : no-repeat;
background-attachment : fixed;
background-position : 50% 50%;
}
-->
</style>

3.背景單張固定(右上)---------------------------------------------------------

<style type=text/css>
<!--
body{
background-image : url(bg.gif);
background-repeat : no-repeat;
background-attachment : fixed;
background-position : 0% 0%;
}
-->
</style>

那個是語法"固定背景"的
<style type="text/css">
<!--
body{background-image: url(圖片網址);
background-repeat:no-repeat;
background-attachment : fixed;
background-position: 10% 20%;}
-->
</style>

◎內置框架透明Iframe 透 明 背 景 (內置框架透明化)

1. 打開您的主網頁,複製程式碼到 <body></body> 之中:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<IFRAME src="網頁二.htm" /*iframe 內的網頁*/
name="frame" /*iframe 名稱*/
width="300" /*寬度(pixel)*/
height="300" /*高度(pixel)*/
style="position:absolute;
left:255; /*位置(從左邊算起)*/
top:100; /*位置(從上面算起)*/
scrolling=choice /*捲軸*/
frameborder="0" /*邊框*/
allowtransparency="true">
</IFRAME>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
要確定絕對不能刪去 "allowtransparency="true" 這一行喔!

2. 打開您 iframe 裡面的網頁,複製程式碼到 <head></head> 之中:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<style type="text/css">
<!-- BODY {background:none transparent;color:#000000}-->
</style>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

編輯內容:

不需修改,但如果 iframe 裡的網頁裡有先預設背景圖/背景顏色,要先把該設定刪除喔

◎ 改變「內置框架」的捲軸顏色的語法要複製在html的哪裡
</head>的上方
也就是:
<html>
<head>
<meta name="GENERATOR" c>
<meta name="ProgId" c>
<meta http-equiv="Content-Type" c>
<title>新增網頁1</title>
貼在這裡以上的位置都可以
</head>

◎有關網頁框架,要如何變透明呢?
中間的框架想要大一點,必須調整外框架的iframe語法中的寬度和高度,
如下方黑色粗體字<IFRAME allowTransparency="true"
border=0 name=I1 src="2.htm" frameBorder=0 width=502 height=355 >
背景要透明必須修改兩個地方,1是在外框架的<iframe>中加上allowTransparency="true",就像上方紅字部分。
2是在內框架的<BODY>後將背景色改為transparent例如這樣:<BODY style="background:transparent">
這兩處修改過後,內框架的背景就會變透明

◎ 內置框架全透明
原來要用內置框架全透明先得(放在<body></body>內)
<iframe src="內置框架顯示的網頁" name=chung width=200 height=200 frameborder=no scrolling=no style="FILTER: Chroma(Color=white)"></iframe>
FILTER: Chroma(Color=white) //white 是 透明了的顏色,
必須是和網頁背景色一樣,否則無法透明,
如捲軸色 也是和 已設定的顏色 一樣,這也會變成 透明的

◎內置頁框
<iframe width="350" height="150" src="網址" frameborder="no" scrolling="auto" name="top" style="border: 1 solid #0F6C99"></iframe>
使 用 方 法
1:將上列程式複製到<BODY></BODY>之中

程 式 說 明
width → 頁框的寬度(單位:像素)
height → 頁框的寬度(單位:像素)
src → 頁框內開啟的網頁(路徑或網址)
frameborder → 頁框是否要有框線(YES 或 NO)
scrolling → 是否使用捲軸(YES 或 NO)
name → 頁框的名稱

◎慢慢浮現的圖片
‧要點一:Script和Style語法請置於<head>與</head>之間。
‧要點二:希望使用此效果的圖片語法後別忘了加上 ID="alpha" 與 JAVASCRIPT">
<!--
var speed = 50; //speed,越小越早。
var o = 1;
function alphaImg() {
if (document.all) {
document.all("alpha").filters["alpha"].opacity = o;
if (o <= 100) {
o += 1;
tim = setTimeout("alphaImg()",speed);
} else clearTimeout(tim);
}
}
// -->
</SCRIPT>

<STYLE TYPE="text/css">
<!--
#alpha { filter:alpha(style=0,opacity=0); }
-->
</STYLE>

</HEAD>
<BODY>

<IMG src="title.gif" width="270" height="70" border="0" ID="alpha" >

</BODY>
</HTML>

................................以上都是由網路上搜刮來的可以參考看看.......................................

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。