如果你會切圖!請繞行!

~~~~

想學圖的,請往下看。
此文有兩個假設(shè)

1、你會使用ps切圖
2、你已學到浮動布局板塊《CSS入門選》~~~~
如果不會PS切圖可以留言哈,四種psd切圖方法與你分享。
如" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

15158846557 在線咨詢 在線咨詢
15158846557 在線咨詢
所在位置: 首頁 > 營銷資訊 > 網(wǎng)站運營 > 手把手教你切圖(DIV+CSS)

手把手教你切圖(DIV+CSS)

時間:2023-09-09 21:24:01 | 來源:網(wǎng)站運營

時間:2023-09-09 21:24:01 來源:網(wǎng)站運營

手把手教你切圖(DIV+CSS):~~~~

如果你會切圖!請繞行!

~~~~

想學圖的,請往下看。
此文有兩個假設(shè)


1、你會使用ps切圖
2、你已學到浮動布局板塊《CSS入門選》
~~~~
如果不會PS切圖可以留言哈,四種psd切圖方法與你分享。
如果不會浮動布局留言哈,得抽一章詳細到你懂,只為你。
是不是很感動?。

~~~~

準備開始
ps sub 都打開
見圖

哇哦!

我們今天只講一部分,后期可以講多個模塊。

導(dǎo)航就是今天的主題!

那看到圖,要怎么開始!

萬事開頭難!

~~~~

開始之前我們選簡單介紹幾個知識點
1、網(wǎng)頁有內(nèi)容區(qū),不能完全按設(shè)計稿的走。如圖,導(dǎo)航的內(nèi)容就叫內(nèi)容區(qū),兩邊的空白是設(shè)計的美感。
2、一般網(wǎng)頁的寬度為:960,980,1001,1280,1380。我說的是px像素哈。
3、網(wǎng)頁的字體正常只有宋體與微軟雅黑。
4、網(wǎng)頁的字體大?。涸缙谑?2px 14px 16px 16是導(dǎo)航部分,最大的字體
5、現(xiàn)在的字體大?。?4px 16px 18px
6、塊間距為10px 15px 20px 30px
當然還有很多,網(wǎng)頁是有標準的,行業(yè)大概是27,28左右。但也要看設(shè)計了。
~~~~




完成一個導(dǎo)航,純藍色,字體,距離都要與設(shè)計稿一樣。

先ps 量一下大小。

少俠你量多少呀!

是不是w:968px h:36px?

錯。

正常是w:967px h:40px

默認樣式

/*** @author 象天* 2010-09-07***////5b8b/4f53//$yh:'Microsoft Yahei';body, textarea, input, select, option { font-size: 12px; color: #333; font-family: "Microsoft Yahei","Hiragino Sans GB", tahoma, arial, sans-serif; -webkit-font-smoothing: antialiased;}h1, h2, h3, h4, h5, h6 { font-size: 100%;}body, h1, h2, h3, h4, h5, h6, blockquote, ol, ul, dl, dd, p, textarea, input, select, option, form { margin: 0;}ol, ul, textarea, input, option, th, td { padding: 0;}table { border-collapse: collapse;}li { list-style-type: none;}article, aside, details, figcaption, figure, footer, header, menu, nav, section { display: block;}.clearfix:after {content:'.';display:block;height:0;clear:both;visibility:hidden;}.clearfix {*zoom:1;}.clear { clear: both; height: 0; overflow: hidden;}a { text-decoration: none; color: #333;}a, textarea, input, select { outline: none;}textarea { overflow: auto; resize: none;}.img img { display: block;}a img { border: none;}//.z-index {// position: fixed;// _position: absolute;// z-index: 999;// display: none;// overflow: hidden;//}.pr { position: relative;}.pa { position: absolute;}.fl { float: left;}.fr { float: right;}a:hover { text-decoration: underline;}.m { margin: 0 auto; width: 960px;}.t10 { margin-top: 10px;}.hide { display: none;}.show { display: block;}/**去ie10 小X*/::-ms-clear { display: none;}::-ms-reveal { display: none;}/** placeholder color更改*/::-webkit-input-placeholder { /* WebKit browsers */ color:#ccc;}:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color:#ccc;}::-moz-placeholder { /* Mozilla Firefox 19+ */ color:#ccc;}:-ms-input-placeholder { /* Internet Explorer 10+ */ color:#ccc;}HTML標準結(jié)構(gòu)

<!DOCTYPE html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>切圖</title> <link rel="stylesheet" type="" href="css/index.css"></head><body></body></html>以上是一個標準結(jié)構(gòu)

下面是版本一:

HTML代碼

<div class="nav clearfix"> <a href="#" class="sp">首頁</a> <a href="#">學校概況</a> <a href="#">新聞公告</a> <a href="#">課程設(shè)置</a> <a href="#">師資力量</a> <a href="#">學子風采</a> <a href="#">資料中心</a> <a href="#">招賢納士</a> <a href="#">聯(lián)系我們</a> <a href="#">留言咨詢</a></div>CSS樣式

.nav { width:967px; height:40px; background:blue; margin:50px auto;}.nav a { float:left; height:40px; line-height:36px; width:94px; text-align:center; font-size:16px; color:#fff;}.nav a:hover { text-decoration:none;}.nav .sp { margin-left:36px; width:59px;}


gif 掩飾 我稍后給出github地址 里帶有哈。

版本二(使用三層嵌套的形式)

接下來是還原。

HTML代碼

<div class="box2"> <div class="pub-nav"> <div class="pub-l"> <div class="pub-r clearfix nav2"> <a href="#" class="sp">首頁</a> <a href="#">學校概況</a> <a href="#">新聞公告</a> <a href="#">課程設(shè)置</a> <a href="#">師資力量</a> <a href="#">學子風采</a> <a href="#">資料中心</a> <a href="#">招賢納士</a> <a href="#">聯(lián)系我們</a> <a href="#">留言咨詢</a> </div> </div> </div></div>CSS代碼

.box2 { width:967px; height:40px; margin: 50px auto;}.pub-nav { height:40px; background:url(i/pub-nav.png) repeat-x 0 0;}.pub-nav .pub-l { height:40px; background:url(i/pub-l.png) no-repeat 0 0;}.pub-nav .pub-l .pub-r{ height:40px; background:url(i/pub-r.png) no-repeat right 0;}.nav2 a { float:left; height:40px; line-height:36px; width:94px; text-align:center; font-size:16px; color:#fff;}.nav2 a:hover { text-decoration:none;}.nav2 .sp { margin-left:36px; width:59px;}版本三(浮動的形式,為了方式兩邊是半透明)

HTML代碼

<div class="box3 clearfix"> <div class="pub-left"> </div> <div class="pub-right"> </div> <div class="pub-center nav3"> <a href="#" class="sp">首頁</a> <a href="#">學校概況</a> <a href="#">新聞公告</a> <a href="#">課程設(shè)置</a> <a href="#">師資力量</a> <a href="#">學子風采</a> <a href="#">資料中心</a> <a href="#">招賢納士</a> <a href="#">聯(lián)系我們</a> <a href="#">留言咨詢</a> </div></div>CSS代碼

.box3 { width:967px; height:40px; margin: 50px auto;}.pub-left { float:left; width:24px; height:40px; background:url(i/pub-l.png) no-repeat 0 0;}.pub-right { float:right; width:24px; height:40px; background:url(i/pub-r.png) no-repeat 0 0;}.pub-center { margin:0 24px; height:40px; background:url(i/pub-nav.png) repeat-x 0 0;}.nav3 a { float:left; height:40px; line-height:36px; width:94px; text-align:center; font-size:16px; color:#fff;}.nav3 a:hover { text-decoration:none;}.nav3 .sp{ margin-left:12px; width:59px;}





背景圖合并的方法的就不演示了哈

當然除了以上的實現(xiàn)方法,也可以用定位,或其他

今天就只分享兩種方法了哈

PS:標簽的使用,就不各種嘗試了哈,直接用A了

最后貼上github地址:https://github.com/llqfront/firstproname.git

關(guān)鍵詞:把手

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點擊下載Chrome瀏覽器
關(guān)閉