国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

CSS基礎教程十九之CSS圖文混排,圖像簽名,多圖拼接和圖片特效

2024-07-11 08:56:09
字體:
來源:轉載
供稿:網友
學習了CSS布局的定位和浮動,我們可以簡單地做出很多排版和內容拼接。今天就來做幾個簡單的實例展示現在 流行的DIV+CSS布局的方便好用之處。順便也說一下CSS3新增的樣式屬性box-shadow和屬性transform。

一圖文混排
CSS Code復制內容到剪貼板
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
  2. <html xmlns="http://www.w3.org/1999/xhtml">    
  3. <head>    
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />    
  5. <title>CSS布局之圖文混排</title>    
  6. <style type="text/css">    
  7. #test {    
  8. border:#FF00FF solid 2px;    
  9. width:650px;    
  10. height:460px;    
  11. background-color:#CCCCCC;    
  12. margin:auto;    
  13. }    
  14. #img {    
  15. padding-top:3px;    
  16. float:left;    
  17. }    
  18. img {    
  19. width:300px;    
  20. height:350px;    
  21. }    
  22. #text {    
  23. color:#0000FF;    
  24. font-size:18px;    
  25. font-family:"微軟雅黑";    
  26. }    
  27. </style>    
  28. </head>    
  29. <body>    
  30. <div id="test">    
  31. <div id="img">    
  32. <img src="6.jpg" />    
  33. </div>    
  34. <div id="text"> 高圓圓,中國女演員,1979年10月5日出生于北京市豐臺區云崗一個普通的知識分子家庭。1996年高圓圓被廣告公司發掘,隨后拍攝了大量廣告,成為了廣告圈中的模特。1997年高圓圓出演了她的第一部電影《愛情麻辣燙》,從此開始了她的演員生涯。2001年高圓圓參演的電影《十七歲的單車》獲得柏林國際電影節最佳影片銀熊獎。2003年高圓圓首次嘗試古裝武俠劇,在《倚天屠龍記》電視劇中飾演峨眉派掌門周芷若。2005年主演的電影《青紅》獲得戛納國際電影節評審團大獎,同年成為荷蘭國際球根花卉中心中國首屆百合小姐。2008年到2009年,拍攝電影《南京!南京!》,該片獲圣塞斯蒂安國際電影節最佳電影金貝殼獎。2011年憑借電影《單身男女》獲得香港電影金像獎最佳女主角提名。2012年主演陳凱歌導演的影片《搜索》。2013年高圓圓主演的視劇《咱們結婚吧》在央視、湖南衛視黃金檔播出。2014年主演的愛情電影《一生一世》票房突破兩億。電影《君子道》已定檔期2015年國慶檔。    
  35. </div>    
  36. </div>    
  37. </body>    
  38. </html>   
效果圖:


二圖像簽名
JavaScript Code復制內容到剪貼板
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
  2. <html xmlns="http://www.w3.org/1999/xhtml">    
  3. <head>    
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />    
  5. <title>CSS布局之圖像簽名</title>    
  6. <style type="text/css" 
  7. #test {    
  8. border:#FF00FF solid 2px;    
  9. width:720px;    
  10. position:absolute;/*讓文字不會脫離圖片*/    
  11. top:50px;    
  12. }    
  13. img {    
  14. width:720px;    
  15. height:480px;    
  16.  
  17. #text {    
  18. color:#0000FF;    
  19. font-size:24px;    
  20. font-family:"華文隸書";    
  21. position:absolute;    
  22. bottom:50px;    
  23. right:50px;    
  24. }    
  25. </style>    
  26. </head>    
  27. <body>    
  28. <div id="test">    
  29. <div id="img">    
  30. <img src="10.jpg" />    
  31. </div>    
  32. <div id="text">    
  33. 國民女神————高圓圓    
  34. </div>    
  35. </div>    
  36. </body>    
  37. </html>   
效果圖:


三多圖拼接
JavaScript Code復制內容到剪貼板
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
  2. <html xmlns="http://www.w3.org/1999/xhtml">    
  3. <head>    
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />    
  5. <title>CSS布局之圖片拼接</title>    
  6. <style type="text/css" 
  7. #box {    
  8. margin:auto;    
  9. height:600px;    
  10. width:690px;    
  11. }    
  12. .test {    
  13. height:300px;    
  14. width:690px;    
  15. }    
  16. .img {    
  17. height:300px;    
  18. width:230px;    
  19. float:left;    
  20. }    
  21. img {    
  22. height:300px;    
  23. width:230px;    
  24. }    
  25. </style>    
  26. </head>    
  27. <body>    
  28. <div id="box">    
  29. <div class="test">    
  30. <div class="img"><img src="16.jpg" /></div>    
  31. <div class="img"><img src="17.jpg" /></div>    
  32. <div class="img"><img src="18.jpg" /></div>    
  33. </div>    
  34. <div class="test">    
  35. <div class="img"><img src="19.jpg" /></div>    
  36. <div class="img"><img src="20.jpg" /></div>    
  37. <div class="img"><img src="21.jpg" /></div>    
  38. </div>    
  39. </div>    
  40. </body>    
  41. </html>      

     效果圖:   

           四圖片特效    

        我們在做這個實例之前先來簡單的介紹CSS3新增的樣式屬性:box-shadow(邊框陰影)和transform(旋轉特效)。在 學習CSS的時候學到了很多的盒子模型的樣式屬性,加以結合也會做出很好的效果。

詳細的看一看:CSSbo
.shadow屬性和CSStransform屬
.()邊框陰影屬性:box-shad
.設置元素的陰影,其實沒有邊框也可以添加陰影
.語法規
.box-shadow:apbpcp#xxxxx
.box-shadow:apbpcprgb(,,,.
.apx表示水平方向的移動;bpx表示豎直方向的移動;cpx表示陰影的模糊距離;最后面的為顏色
.()旋轉特效屬性:transfo
.設置元素的旋轉,向元素應用D或D轉換。該屬性允許我們對元素進行旋轉、縮放、移動或傾
.transform:rotate(angle單位為deg)定義D旋轉在參數中規定角度,angle表示角

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
  2. <html xmlns="http://www.w3.org/1999/xhtml">    
  3. <head>    
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />    
  5. <title>CSS布局之圖片特效</title>    
  6. <style type="text/css">    
  7. body {    
  8. margin:30px;    
  9. background-color:#CCCCCC;    
  10. }    
  11. div.polaroid {    
  12. width:294px;    
  13. padding:10px;    
  14. margin:10px;    
  15. border:1px solid #BFBFBF;    
  16. background-color:#FFFFFF;    
  17. box-shadow:10px 10px 10px #999999;/*圖片陰影的設置*/    
  18. }    
  19. div.rotate_left {    
  20. float:left;    
  21. transform:rotate(8deg);/*圖片向右傾倒*/    
  22. }    
  23. div.rotate_right {    
  24. float:left;    
  25. transform:rotate(-8deg);/*圖片向左傾倒*/    
  26. }    
  27. </style>    
  28. </head>    
  29. <body>    
  30. <div class="polaroid rotate_left">    
  31. <img src="http://www.w3school.com.cn//i/ballade_dream.jpg" alt="郁金香" width="284" height="213" />    
  32. <p class="caption">上海鮮花港的郁金香,花名:Ballade Dream。</p>    
  33. </div>    
  34. <div class="polaroid rotate_right">    
  35. <img src="http://www.w3school.com.cn//i/china_pavilion.jpg" alt="世博中國館" width="284" height="213" />    
  36. <p class="caption">2010年上海世博會,中國館。</p>    
  37. </div>    
  38. </body>    
  39. </html>   
效果圖:


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 理塘县| 河西区| 银川市| 怀仁县| 手游| 辛集市| 博爱县| 临泉县| 含山县| 忻城县| 石门县| 连州市| 松阳县| 南郑县| 昭苏县| 忻州市| 鄂州市| 沙坪坝区| 涿鹿县| 佳木斯市| 黄梅县| 罗田县| 滦平县| 营山县| 荔浦县| 泸溪县| 南汇区| 天峻县| 通城县| 志丹县| 周至县| 安陆市| 德江县| 新民市| 泸溪县| 高密市| 抚顺市| 灵川县| 新闻| 宜昌市| 阿克苏市|