Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 久久91精品国产91久久户 ,成人久久18网站,99久久免费费视频在线观看

          整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          HTML從基礎到精通-css布局

          天小編為大家介紹五種css樣式布局以及內服源代碼作為介紹,采用的方式是行內級樣式(就是將css樣式代碼與html寫在一起)

          已知布局元素的高度,寫出三欄布局,要求左欄、右欄寬度各為300px,中間自適應。

          一、浮動布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>浮動布局</title>

          <style type="text/css">

          .wrap1 div{

          min-height: 200px;

          }

          .wrap1 .left{

          float: left;

          width: 300px;

          background: red;

          }

          .wrap1 .right{

          float: right;

          width: 300px;

          background: blue;

          }

          .wrap1 .center{

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap1">

          <div class="left"></div>

          <div class="right"></div>

          <div class="center">

          浮動布局

          </div>

          </div>

          </body>

          </html>

          浮動布局的兼容性比較好,但是浮動帶來的影響比較多,頁面寬度不夠的時候會影響布局。

          二、絕對定位布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>絕對定位布局</title>

          <style type="text/css">

          .wrap2 div{

          position: absolute;

          min-height: 200px;

          }

          .wrap2 .left{

          left: 0;

          width: 300px;

          background: red;

          }

          .wrap2 .right{

          right: 0;

          width: 300px;

          background: blue;

          }

          .wrap2 .center{

          left: 300px;

          right: 300px;

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap2 wrap">

          <div class="left"></div>

          <div class="center">

          絕對定位布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          絕對定位布局快捷,但是有效性比較差,因為脫離了文檔流。

          三、flex布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>flex布局</title>

          <style type="text/css">

          .wrap3{

          display: flex;

          min-height: 200px;

          }

          .wrap3 .left{

          flex-basis: 300px;

          background: red;

          }

          .wrap3 .right{

          flex-basis: 300px;

          background: blue;

          }

          .wrap3 .center{

          flex: 1;

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap3 wrap">

          <div class="left"></div>

          <div class="center">

          flex布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          自適應好,高度能夠自動撐開

          四、table-cell表格布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>table-cell表格布局</title>

          <style type="text/css">

          .wrap4{

          display: table;

          width: 100%;

          height: 200px;

          }

          .wrap4>div{

          display: table-cell;

          }

          .wrap4 .left{

          width: 300px;

          background: red;

          }

          .wrap4 .right{

          width: 300px;

          background: blue;

          }

          .wrap4 .center{

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap4 wrap">

          <div class="left"></div>

          <div class="center">

          表格布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          兼容性好,但是有時候不能固定高度,因為會被內容撐高。

          五、網格布局

          <!DOCTYPE html>

          <html>

          <head>

          <meta charset="utf-8" />

          <title>網格布局</title>

          <style type="text/css">

          .wrap5{

          display: grid;

          width: 100%;

          grid-template-rows: 200px;

          grid-template-columns: 300px auto 300px;

          }

          .wrap5 .left{

          background: red;

          }

          .wrap5 .right{

          background: blue;

          }

          .wrap5 .center{

          background: pink;

          }

          </style>

          </head>

          <body>

          <div class="wrap5 wrap">

          <div class="left"></div>

          <div class="center">

          網格布局

          </div>

          <div class="right"></div>

          </div>

          </body>

          </html>

          希望大家可以一直關注我,支持我!感謝!!!

          航欄效果圖:

          導航欄

          導航欄功能模塊圖

          圖書管理功能模塊圖

          圖書管理功能包4括大模塊 ,16個子模塊。


          導航欄布局結構分析

          1. 制作方式: 列表<ul><li>制作。

          四大模塊:用一個<ul><li></li></ul>列表制作出來,每個模塊下面的四個子模塊用同樣的<ul><li></li></ul>列表嵌套出來。

          具體格式如下:

          <ul>
           <li>模塊1
           <ul>
           <li>模塊1.1</li>
           <li>模塊1.2</li>
           <li>模塊1.3</li>
           <li>模塊1.4</li>
           </ul>
           </li>
           <li>模塊2
           <ul>
           <li>模塊2.1</li>
           <li>模塊2.2</li>
           <li>模塊2.3</li>
           <li>模塊2.4</li>
           </ul>
           </li>
          ..........
          </ul>
          

          2.導航標簽<a>:都是一個超鏈接,通過點擊鏈接到相應的導航頁面。

          所以在每個列表選項中,都應該加入超鏈接<a>標簽。

          <ul>
          <li><a href="javascript:;" >用戶管理</a></li>
          ...
          </ul>
          

          3.導航框的修飾:CSS樣式表

          3.1 樣式表接入方式:

          • 行內樣式
          • 內嵌樣式
          • 鏈接式
          • 導入式

          一般用鏈接式<link >,運用高內聚,低耦合的思想。

          <link rel="stylesheet" type="text/css" href="CSS/demo.css">
          

          3.2標簽選擇器

          行內選擇器>id選擇器>class選擇器>標簽選擇器

          常用到的為 id選擇器、class選擇器、標簽選擇器。

          例如:

          <ul>
           <li class="litems"><a href="javascript:;">用戶管理</a>
           <ul class="uitems">
           <li><a href="javascript:;">添加用戶</a></li>
           </ul>
           </li>
          </ul>
          

          具體用法見:HTML/CSS中可直接輸數據的表格

          4.導航欄的框框

          模塊標簽特點:

          1. 背景色background-color :暗紅色;
          2. 形狀:長方塊block 、寬width、高height,左邊有突出小方塊樣式, 分析為內邊距padding。
          3. 內容:字體font-family、字體顏色color、字體大小font-size, 垂直居中line-height=height
          4. 邊框:border:solid 1px #ff0;

          litems類標簽 中 <a>標簽的樣式如下:

           .litems>a
          {
          	background-color:#990020; /*背景色*/
          	height:30px; 
          	display:block; /*塊顯示*/
          	line-height:30px; /*垂直居中*/
          	border-left: solid 12px #711515; /*邊框*/
          	padding-left:5px; /*左邊距*/
          }
          

          5.鼠標懸浮變化--- a:hover 屬性

          鼠標未懸浮狀態

          鼠標懸浮狀態

          特點:鼠標懸浮時,字體變為黃色。

          a:hover
          {
          	color:#FF0;
          }
          
          

          制作一個簡單的導航欄,常用的就是列表格式。通過列表的嵌套和樣式的修改,即可建立一個簡約得體的導航列表。

          以下附帶部分樣式源碼:

          HTML列表內容

          CSS樣式表源碼:

          下是一些常用的HTML網頁源代碼示例,這些示例可用作HTML文檔的基礎:

          1、創建一個簡單的HTML文檔結構:

          <!DOCTYPE html>

          <html lang="en">

          <head>

          <meta charset="UTF-8">

          <meta name="viewport"content="width=device-width,initial-scale=1.0">

          <title>My Web Page</title>

          </head>

          <body>

          <h1>Hello,World!</h1>

          <p>This is a simple HTML webpage.</p>

          </body>

          </html>

          2、插入圖片:

          <img src="image.jpg"alt="Description of the image">

          3、創建超鏈接:

          <a href="https://www.example.com">Visit Example.com</a>

          4、創建無序列表:

          <ul>

          <li>Item 1</li>

          <li>Item 2</li>

          <li>Item 3</li>

          </ul>

          5、創建有序列表:

          <ol>

          <li>First item</li>

          <li>Second item</li>

          <li>Third item</li>

          </ol>

          6、創建表格:

          <table>

          <tr>

          <th>Header 1</th>

          <th>Header 2</th>

          </tr>

          <tr>

          <td>Row 1,Cell 1</td>

          <td>Row 1,Cell 2</td>

          </tr>

          <tr>

          <td>Row 2,Cell 1</td>

          <td>Row 2,Cell 2</td>

          </tr>

          </table>

          7、插入段落:

          <p>This is a paragraph of text.</p>

          8、插入換行符:

          <p>This is some text.<br>This is on a new line.</p>

          9、創建一個文本輸入框:

          <input type="text"name="username"placeholder="Enter your username">

          10、插入按鈕:

          <button type="button">Click me</button>

          這些示例代碼只是HTML的基礎,HTML具有更豐富的功能和標記選項,可以根據需要進行擴展和定制。請根據您的具體需求,使用這些示例作為起點,構建您自己的網頁。

          【名揚銀河企業網站系統】

          【免費】提供企業【網站源碼】,簡單易用,無須擁有代碼基礎。

          歡迎留言或私信我們咨詢。

          以上內容由【名揚銀河】企業網站系統原創發布,轉載請注明出處。


          主站蜘蛛池模板: 国产精品va无码一区二区| 人妻无码第一区二区三区| 亚洲综合一区二区| 日韩一区二区三区视频| 亚洲码一区二区三区| 中文人妻无码一区二区三区| 国模大胆一区二区三区| 2022年亚洲午夜一区二区福利 | 91在线视频一区| 中文字幕精品一区| 国产一区在线视频| 久久精品一区二区三区中文字幕| 日韩精品免费一区二区三区| 亚洲AV无码片一区二区三区| 亚洲男女一区二区三区| 久久国产精品一区免费下载| 精品国产免费一区二区三区香蕉| 精品国产日韩亚洲一区| 成人精品视频一区二区三区 | 亚洲国产精品一区二区成人片国内| 精品久久久久中文字幕一区| 一区二区三区在线|日本| 高清一区二区在线观看| 免费观看日本污污ww网站一区| 免费看无码自慰一区二区| 欧洲亚洲综合一区二区三区| 日美欧韩一区二去三区| 精品视频一区在线观看| 亚洲人AV永久一区二区三区久久| 无码人妻一区二区三区免费视频| 无码国产亚洲日韩国精品视频一区二区三区 | 狠狠色综合一区二区| 亚洲色精品三区二区一区| 国产一区二区不卡老阿姨| 国产萌白酱在线一区二区| 搜日本一区二区三区免费高清视频 | 日韩一本之道一区中文字幕| 亚洲日韩精品一区二区三区 | 国产在线观看一区精品| 久久亚洲国产精品一区二区| 日韩精品中文字幕无码一区|