CSS固定背景上下左右中間

Home Home
引用 | 編輯 親愛的
2005-01-27 23:46
樓主
推文 x0
因為論壇的緣故~所以在分享後有些代碼後會出現一些字體~
如果直接複製貼上是無法顯示的~
所以~~.
在試用下列的語法請把=跟CSS後面的斜線刪除掉就可以了

複製程式
中間
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
background-position : center center;}
-->
</STYLE> 
右下

<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:right bottom;}
-->
</STYLE>
右上
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:right top;}
-->
</STYLE>
左上
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:left top;}
-->
</STYLE>
左下
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:left bottom;}
-->
</STYLE>
左
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:repeat-y;
background-attachment:fixed;
background-position:left center;}
-->
</STYLE>
右
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:repeat-y;
background-attachment:fixed;
background-position:right center;}
-->
</STYLE>
上
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:repeat-x;
background-attachment:fixed;
background-position:center top;}
-->
</STYLE>
下
<STYLE type="text/css">
<!--
BODY{
background-image:url(□□□.jpg);
background-repeat:repeat-x;
background-attachment:fixed;
background-position:center bottom;}
-->
</STYLE>


獻花 x0
引用 | 編輯 EricGo
2005-01-28 09:00
1樓
  
可以寫在一起啦~複製程式
body { background: url(......) no-repeat fixed top left; }
可以到W3 Schools看看……。
另外,在Windows環境下用TopStyle來寫CSS很方便,Lite版可以免費下載使用。

獻花 x0