DBS独立服客服务

查看完整版本: butterfly样式下载及制作教程

redscorpion 2007-2-8 10:33

butterfly样式下载及制作教程

最近想写一下zblog样式的制作过程
就拿我制作butterfly样式做例子



现在先提供样式下载
教程慢慢来

52822827 2007-2-8 11:06

支持楼主,希望早一点能看到楼主的教程~~
期待中~~~~

redscorpion 2007-2-8 15:47

写东西真是太难了。。。
写了好一会,觉得并不完全是写zblog的样式制作
好像在写自己学css的总结
不过估计会有一些帮助

我也是新手,写的不好
错误的地方还请高手指教哈

开始:

这是分离出的页面结构:

[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <link rel="stylesheet" rev="stylesheet" href="style/butterfly.css" type="text/css" media="screen" />
        <title>GaoWhen高温</title>
</head>
<body class="multi default">
       
<!--start of divAll-->
<div id="divAll">
        <!----------------start of divPage---------------->
        <div id="divPage">
               
                <!-----------start of divMiddle--------------->
                <div id="divMiddle">
                       
                        <!-------------start of divTop-------------->
                        <div id="divTop">
                                <h1 id="BlogTitle">GaoWhen高H温 </h1>
                                <h2 id="BlogSubTitle">I just want to live while I am alive ...</h2>
                        </div>
                        <!---------------end of divTop------------>
                       
                        <!------------start of divNavBar------------->
                        <div id="divNavBar">
                        </div>
                        <!-------------end of divNavBar------------>
                       
                        <!------------start of divMain--------------->
                        <div id="divMain">
                                <p>日历</p>
                                <p>控制面板</p>               
                                <p>网站目录</p>       
                                <p>最新留言</p>               
                                <p>最近引用</p>               
                                <p>文章归档</p>               
                                <p>站点统计</p>               
                                <p>网站收藏</p>               
                                <p>友情链接</p>               
                                <p>图标汇集</p>               
                        </div>
                        <!------------end of divMain--------------->
                       
                        <!---------------start of divSidebar---------->
                        <div id="divSidebar">
                                <div class="function" id="divCalendar">
                                        <h3>日历</h3>
                                </div>
                                <div class="function" id="divContorPanel">
                                        <h3>控制面板</h3>
                                </div>
                                <div class="function" id="divCatalog">
                                        <h3>网站目录</h3>
                                </div>
                                <div class="function" id="divComments">
                                        <h3>最新留言</h3>
                                </div>
                                <div class="function" id="divTrackbacks">
                                        <h3>最近引用</h3>
                                </div>
                                <div class="function" id="divArchives">
                                        <h3>文章归档</h3>
                                </div>
                                <div class="function" id="divStatistics">
                                        <h3>站点统计</h3>
                                </div>
                                <div class="function" id="divFavorites">
                                        <h3>网站收藏</h3>
                                </div>
                                <div class="function" id="divLinkage">
                                        <h3>友情链接</h3>
                                </div>
                                <div class="function" id="divMisc">
                                        <h3>图标汇集</h3>
                                </div>
                        </div>
                        <!---------------end of divSidebar---------------->
                       
                <!----------------start of divBottom--------------------->
                <div id="divBottom">
                        <h3 id="BlogPowerBy"></h3>
                        <h2 id="BlogCopyRight"></h2>
                </div>
                <!----------------end of divBottom--------------------->
               
                </div>
                <!----------------end of divMiddle------------------->
               
        </div>
        <!---------------end of divPage------------>
       
</div>
<!--------------end of divAll----------->

</body>
</html>
[/code]


新建一个文本文档,将上面代码拷贝进去,另存为index.html,编码选择  utf-8
效果:
[img]http://www.gaowhen.com/upload/divAll_without_color.JPG[/img]

建立目录结构如下:
   zblog--------index.html
             |--style
             |--image
在style目录下新建butterfly.css文件

下文提到表现的地方均为向 butterfly.css 添加代码

表现:

[CODE]
#divAll{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Silver;
}
[/CODE]

效果:
[img]http://www.gaowhen.com/upload/divAll.JPG[/img]

表现:
[CODE]
#divAll{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Silver;
}
#divPage{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Aqua;
}
[/CODE]

效果:
[img]http://www.gaowhen.com/upload/divAll_page.JPG[/img]

表现:
[CODE]
#divAll{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Silver;
}
#divPage{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Aqua;
}
#divMiddle{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Blue;
}
[/CODE]

效果:
[img]http://www.gaowhen.com/upload/divMiddle.JPG[/img]

表现:
[CODE]
#divAll{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Silver;
}
#divPage{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Aqua;
}
#divMiddle{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Blue;
}
#divTop{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        height:231px;
        background-color: Red;
}
#divSidebar{
        width:256px;
        margin:0 0 0 0;
        padding:0 0 0 12px;
        background-color: Lime;
}

#divMain{
        width:700px;
        margin:0 0 0 0;
        padding:0 8px 0 0;
        background-color: Yellow;
}

#divBottom{
        width:1000px;
        margin:0;
        padding:0;
        height:88px;
        background-color: Purple;
        }
[/CODE]

效果:
[img]http://www.gaowhen.com/upload/no_float.jpg[/img]

表现:
[CODE]
#divAll{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Silver;
}
#divPage{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Aqua;
}
#divMiddle{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        background-color: Blue;
}
#divTop{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        height:231px;
        background-color: Red;
}
#divSidebar{
        width:256px;
        margin:0 0 0 0;
        padding:0 0 0 12px;
        float:left;
        background-color: Lime;
}

#divMain{
        width:700px;
        margin:0 0 0 0;
        padding:0 8px 0 0;
        float: right;
        background-color: Yellow;
}

#divBottom{
        width:1000px;
        margin:0;
        padding:0;
        height:88px;
        background-color: Purple;
        }
[/CODE]

效果:
[img]http://www.gaowhen.com/upload/with_float.jpg,with_float.jpg[/img]


现在已经可以看到页面的大体模型结构了。。。

[[i] 本帖最后由 redscorpion 于 2007-2-8 15:49 编辑 [/i]]

tifa 2007-2-8 18:52

学习了.......还有没有?

52822827 2007-2-8 23:06

写的很详细,我菜鸟也能慢慢看懂了,谢谢楼主,精神可嘉!:lol

redscorpion 2007-2-9 13:06

header背景图片:  but.jpg 1000×231
[attach]658[/attach]

footer 背景图片:   b.jpg 1000×88
[attach]659[/attach]

Article 背景图片:  article.JPG  500×252
[attach]660[/attach]

日历 背景图片: cal.jpg   264×200
[attach]661[/attach]

以上是用到的主要图片。
现在我们就可以用这些图片把这些难看的颜色块去掉了。
首先添加头部的图片,只要对#divTop做下修改就可以了

[code]
#divTop{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        height:231px;
[color=Red]        /*background-color: Red;*/
        background: url(../image/but.jpg) no-repeat;[/color]
}
[/code]

效果如下:
[attach]662[/attach]

同样,修改#divSidebar、#divBottom,增加图片,并去掉所有色块的颜色。
此时的css文件:
[code]
#divAll{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        [color=Red]/*background-color: Silver;*/[/color]
}
#divPage{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        [color=Red]/*background-color: Aqua;*/[/color]
}
#divMiddle{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        [color=Red]/*background-color: Blue;*/[/color]
}
#divTop{
        width:1000px;
        margin:0 0 0 0;
        padding:0 0 0 0;
        height:231px;
[color=Red]        /*background-color: Red;*/
        background: url(../image/but.jpg) no-repeat;[/color]
}
#divSidebar{
        width:256px;
        margin:0 0 0 0;
        padding:0 0 0 12px;
        float:left;
[color=Red]        /*background-color: Lime;*/
        background: url(../image/sidebar.jpg) repeat-y;/*--图片在垂直方向重复--*/[/color]
}

#divMain{
        width:700px;
        margin:0 0 0 0;
        padding:0 8px 0 0;
        float: right;
[color=Red]        /*background-color: Yellow;*/[/color]
}

#divBottom{
        width:1000px;
        margin:0;
        padding:0;
        height:88px;
[color=Red]        /*background-color: Purple;*/
        background: url(../image/b.jpg) no-repeat;[/color]
        }
[/code]

效果:
[attach]664[/attach]

比以前好看了很多吧。下面我就就开始着手处理文字的位置和样式。
先设置全局的字体,局部的在相应的class中再设置
[code]
body{
        margin:0;
        padding:0;
        color:#333333;
        font-size:12px;
        font-family: Lucida Grande, Lucida Sans Unicode, Verdana, Arial, sans-serif;
}
[/code]
为了不遮住图片,我要把 GaoWhen高H温以及I just want to live while I am alive…挪到右边显示,则对应要设置的即为 #BlogTitle、#BlogSubTitle,相关内容请查阅css2中文手册。
[code]
#BlogTitle{
        font-size:32px;
[color=Red]        margin:54px 0 0 700px;/*--顺序上、右、下、左--*/[/color]
        padding:0;
        font-weight:bold;
}
#BlogSubTitle{
        color:#7c5b0e;
        font-size:12px;
[color=Red]        margin:2px 0 0 750px;[/color]
        padding:0;
}
[/code]
效果:
[attach]663[/attach]

[[i] 本帖最后由 redscorpion 于 2007-2-9 13:16 编辑 [/i]]

seag 2007-2-9 14:39

谢谢LZ  我要好好学习下

星夜天河 2007-2-9 23:02

很好啊,刚接触,可以好好学习了。太感谢楼主了,

Google 2007-2-9 23:35

:victory:  好帖子,授人以“渔”,支持。

dinggg1 2007-2-10 10:23

LZ好人啊!!

Hana 2007-2-11 19:54

好帖!

redscorpion 2007-2-12 11:14

第三篇已经发布

请登陆[url=http://www.gaowhen.com]http://www.gaowhen.com[/url]
观看

我这么辛苦的写
也请你帮我增加点流量吧
谢谢:loveliness:

redscorpion 2007-2-13 20:29

又重新看了一下
基本上我修改的时候也就修改了这么多
大家可以参照以上
借助css2中文手册修改一下其他的东西
毕竟我现在也是刚接触
没有那么多积淀

所以这个教程目前暂时草草收场
但是以后肯定还是要更新的
:loveliness:

顺便祝大家
新年快乐
心想事成

lowsen 2007-3-8 15:40

谢谢好东西啊~~~~~~~~~~~```

Kview 2007-5-23 20:56

楼猪楼猪法力无边

birdmj 2007-6-2 19:47

bucu

birdmj 2007-6-2 19:48

不错

赞一个,同时进你的BLOG逛一圈

蜀狂 2007-6-22 23:21

非常感谢高温

houlin789 2007-6-28 23:22

这应该算精华帖``````

woolin 2007-7-3 11:49

疑问

楼主这个教程很不错的,但有个问题请教一下,也许我的问题很简单,你的那个网页为什么要用不同的背景色啊,你方了图片以后不是什么颜色都没有了吗。难道是为了在做的时候比较好区分吗?

redscorpion 2007-7-8 10:25

就是为了区分,但是其实眼睛分辨不出来的,呵呵,你可以看看css文件。。。

随风漫舞 2007-7-10 20:10

很完美的帖子。不得不佩服!

luwei8989 2007-7-27 15:22

有创意

cenyi 2007-8-2 08:55

不错的教程,这只是初学者迫切希望的教程。易懂,楼主为人民服务的精神值得嘉奖:lol !!
页: [1] 2
查看完整版本: butterfly样式下载及制作教程