主頁 > 企業開發 > CSS基礎-背景

CSS基礎-背景

2023-06-30 08:20:28 企業開發

背景

background-color

背景顏色, 可以使用十六進制、rgb、rgba表示,

語法


/**selector  背景元素的原則去*/
/** color  背景顏色的值, 可以是 顏色名稱、十六進制值、RGB、RGBA*/
selector {
  background-color: color;
}

示例

/** 設定body標簽背景為白色 */
body {
  background-color: white;
}

/**設定h1標簽背景為紅色*/
h1 {
  background-color: #ff0000;
}

/**設定p元素背景顏色為黃色*/
p {
  background-color: rgb(255, 255, 0);
}

/**設定背景顏色為半透明的藍色*/
div {
  background-color: rgba(0, 0, 255, 0.5);
}

background-image

背景圖片;該屬性可以通過圖片路徑參考一張外部圖片,圖片路徑可以是相對論路徑、絕對路徑也可以是網路當中圖片,支持HTTP協議,

語法

/**selector  表示選擇器*/
/**url 圖片路徑*/
/**相對路徑是書寫位置到圖片位置的相對路徑
*/
selector {
  background-image: url(url);
}

示例

創建一個網頁, 使得body、h1、div 擁有不同的背景圖片,

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>背景圖片演示</title>
    <style>
			/**相對路徑, images目錄下必須要有 background-body.jpg 圖片*/
      body {
        background-image: url("images/background-body.jpg");
      }
			/**參考網路當中的圖片*/
      h1 {
        width: 100px;
        height: 100px;
        background-image: url("https://pic4.zhimg.com/v2-bbddbb4b7769475ccb591cc39106b146_r.jpg?source=1940ef5c");
      }
		  /**使用 linear-gradient 漸變函式*/
      div {
        width: 100px;
        height: 100px;
        background-image: linear-gradient(to right, red, orange, yellow);
      }
    </style>
  </head>
  <body>
    <h1></h1>
    <div></div>
  </body>
</html>

線性漸變

background-image屬性可以使用 linear-gradient()形式創建線性漸變背景,

background-image: linear-gradient(to right, blue, red)
                                    漸變方向 開始顏色 結束顏色						
#漸變方向也可以用度數表示
background-image:  linear-gradient(45deg, blue, red)

#可以有多個顏色值
background-image: linear-gradient(to right, blue, yellow 20%, red)
																										表示中間色

linear-gradient 的詳細用法可以參考 地址:https://developer.mozilla.org/zh-CN/docs/Web/CSS/gradient/linear-gradient

backgroud-repeat 重復方式

background-repeat 屬性用來設定背景的重復模式,

意義
repeat; x、y均平鋪(默認)
repeat-x; x平鋪
repeat-y; y平鋪
no-repeat; 不平鋪

示例

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>背景是否重復背景展示</title>
    <style>
      div {
        border: 1px solid red;
        width: 900px;
        height: 600px;
        margin-bottom: 10px;
        background: transparent
          url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
      }

      .box1 {
        background-repeat: repeat;
      }

      .box2 {
        background-repeat: repeat-x;
      }

      .box3 {
        background-repeat: repeat-y;
      }

      .box4 {
        background-repeat: no-repeat;
      }

      body {
        background-image: url(https://pic4.zhimg.com/v2-bbddbb4b7769475ccb591cc39106b146_r.jpg?source=1940ef5c);
      }
    </style>
  </head>
  <body>
    <div >box1背景重復(默認)</div>
    <div >box2背景X軸重復</div>
    <div >box3背景Y軸重復</div>
    <div >box4背景不重復</div>
  </body>
</html>

background-size 背景尺寸

  • background-size 屬性用來設定 背景圖片的尺寸,兼容到IE9,
  • background-size 的值可以用像素表示,也可以用百分比表示,表示為盒子寬、高的百分之多少,
  • 需要等比例的值,用auto代替,
  • contain 特殊值, 背景智能改變尺寸以容納到盒子里, 可能背景會出現空白區域,
  • cover 特殊值, 將背景圖片智能改變尺寸以撐滿盒子,
/* 設定一個值, 此時代表的是背景圖片的寬度,高度默認auto*/
background-size: 50%;
background-size: 3.2em;
background-size: 12px;
background-size: auto;

/* 第一個值設定寬度,第二個值設定高度 */
background-size: 50% auto;
background-size: 3em 25%;
background-size: auto 6px;
background-size: auto auto;

示例

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>背景大小設定</title>
    <style>
      /* background-size 使用 auth */
      .box1 {
        width: 500px;
        height: 300px;
        border: 1px solid #000;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-size: 300px auto;
        margin-bottom: 10px;
      }

      /* background-size 使用百分比 */
      .box2 {
        width: 500px;
        height: 300px;
        border: 1px solid #000;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-size: 50% 50%;
        margin-bottom: 10px;
      }

      /* background-size 使用 contain 智能背景圖片尺寸,以容納到盒子里 */
      .box3 {
        width: 400px;
        height: 300px;
        border: 1px solid #000;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-size: contain;
        background-repeat: no-repeat;
        margin-bottom: 10px;
      }

      /* background-size 使用 cover 智能改變尺寸,以撐滿盒子 */
      .box4 {
        width: 400px;
        height: 300px;
        border: 1px solid #000;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-size: cover;
        margin-bottom: 10px;
      }
    </style>
  </head>
  <body>
    <div ></div>
    <div ></div>
    <div ></div>
    <div ></div>
  </body>
</html>

background-clip 背景繪制區域

指定背景的繪制區域,

默認情況下,背景被繪制到元素的邊框外沿,但是可以通過 background-clip 屬性來控制背景的繪制區域,

語法

background-clip: border-box | padding-box | content-box;

  • border-box: 背景延伸至邊框外沿(但是在邊框下層), 默認值,
  • padding-box: 背景延伸至內邊距([padding](https://developer.mozilla.org/zh-CN/docs/Web/CSS/padding))外沿,不會繪制到邊框處,
  • content-box: 背景被裁剪至內容區(content box)外沿,

示例

三種取值的演示

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>控制背景的控制區域</title>
    <style>

        /* 裁剪到內容區域 */
        .box1 {
            width: 400px;
            height: 300px;
            padding: 50px;
            border: 10px dotted red;
            background-color: yellow;
            background-clip: content-box;
            margin-bottom: 10px;
        }

        /* 裁剪至邊框區域(包含border) */
        .box2 {
            width: 400px;
            height: 300px;
            padding: 50px;
            border: 10px dotted red;
            background-color: yellow;
            background-clip: border-box;
            margin-bottom: 10px;
        }

        /* 裁剪至pading區域(包含padding) */
        .box3 {
            width: 400px;
            height: 300px;
            padding: 50px;
            border: 10px dotted red;
            background-color: yellow;
            background-clip: padding-box;
        }

        
    </style>
</head>
<body>
    <div >div1</div>
    <div >div2</div>
    <div >div3</div>
</body>
</html>

background-origin 背景圖片定位區域

指定背景圖片的定位區域,

默認情況下,背景圖片的定位區域是元素的 padding box,但是可以使用 background-origin 屬性來控制背景圖片的定位區域,

語法

background-origin: border-box | padding-box | content-box;

  • border-box:背景圖片的擺放以 border 區域為參考, 以邊框的左上角外沿為基準,
  • padding-box:背景圖片的擺放以 padding 區域為參考, 以padding的左上角外沿為基準,
  • content-box:背景圖片的擺放以 padding 區域為參考,以 padding內真正的內容的外沿為基準,

示例

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>background-origin 定位起始位置</title>
    <style>
      /*  背景圖片/顏色 從 邊框開始(包含邊框) */
      .box1 {
        height: 400px;
        width: 300px;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-origin: border-box;
        background-repeat: no-repeat;
        border: 10px dotted red;
      }

      /*  背景圖片/顏色 從 內容開始 (包含內容) */
      .box2 {
        height: 400px;
        width: 300px;
        padding: 30px;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        border: 10px dotted red;
        background-origin: content-box;
        background-repeat: no-repeat;
      }

      /* 默認 background-origin 是 padding-box 
           background-origin 從 padding 開始(包含padding區域)
        */
      .box3 {
        height: 400px;
        width: 300px;
        padding: 30px;
        border: 10px dotted red;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-repeat: no-repeat;
        /* background-origin: padding-box; */
        background-clip: padding-box;
      }
    </style>
  </head>
  <body>
    <div ></div>
    <div >qqqqd</div>
    <div ></div>
  </body>
</html>

background-attachment

background-attachment 決定了背景影像的位置是在視口內固定,或者包含它的區塊滾動,

意義
fixed 背景影像固定在視口中,不隨頁面滾動而滾動,
local 背景影像會隨著元素內容的滾動而滾動,而不是隨頁面滾動而滾動,
scroll 背景影像會隨著頁面的滾動而滾動(默認),
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>背景定位演示</title>
    <style>
      body {
        height: 3000px;
      }
      .box1 {
        position: relative;
        top: 100px;
        width: 200px;
        height: 200px;
        border: 1px solid #000;
        /* 縱向溢位的內容,用滾動條顯示 */
        overflow-y: scroll;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-attachment: scroll;
      }
    </style>
  </head>
  <body>
    <div >
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
      <p>內容1</p>
    </div>
  </body>
</html>

background-position 圖片其實位置

精確設定影像的初始位置,屬性值可以使用 px 像素描述,也可以用 top、bottom、center、left、right描述圖片的位置,

/**水平方向 在上, 垂直方向 默認為 center*/
background-position: top;

/**水平方向 在左, 垂直方向再上 (左上角)*/
background-position: left top;

/**定義了 水平位置 25% 垂直位置25%, 左上角 定義為 0%, 右下角定義為 100% 100%*/
background-position: 25% 75%;

/**水平位置 10像素 垂直為 10像素 , 左上角定義為 0px 0px*/
background-position: 10px 10px;

示例

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>背景圖片定位位置</title>
    <style>
      .box1 {
        width: 200px;
        height: 200px;
        border: 1px solid black;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-size: 50% auto;
        background-repeat: no-repeat;
        background-position: 0px 0px;
      }

      .box2 {
        width: 200px;
        height: 200px;
        border: 1px solid black;
        background-image: url(https://ts1.cn.mm.bing.net/th/id/R-C.2fb5b20787d386d13c553acd9195367b?rik=SVaO4tCMUb4Wrw&riu=http%3a%2f%2fpic.616pic.com%2fys_img%2f00%2f18%2f72%2fVSjXnSgVHI.jpg&ehk=IeIi2DES5PyvRSxSW1k74c0befZUHhZdHWklbVTPQXM%3d&risl=&pid=ImgRaw&r=0);
        background-size: 50% auto;
        background-repeat: no-repeat;
        background-position: top right;
      }
    </style>
  </head>
  <body>
    <div ></div>
    <div ></div>
  </body>
</html>

精靈圖技術

將多個小圖示放在一個圖片上,并使用 background-position 技術只顯示其中一個,

優點: 減少http請求次數

缺點: 不方便測量,后期改動麻煩

示例

展示精靈圖

  1. 網路中搜索隨便搜索一張CSS精靈圖 https://img-blog.csdnimg.cn/20201101235915402.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0xJVUNIVUFOUUkxMjM0NQ==,size_16,color_FFFFFF,t_70#pic_center

  2. 使用 PS 測量圖示在圖片當中的位置

    ps中選擇切片工具, 選擇需要測量的圖片后雙擊,彈出層終的 x、y表示其在圖片中的橫縱坐標位置, w、h分別表示圖片的寬度和高度

  3. 撰寫代碼

    指定 background-position: - 376px 0px; (以盒子左上角為原點, 相當于把 圖片往左拉動 376 像素,往上拉動 0px )

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>css精靈圖演示</title>
        <style>
          .dui {
            position: absolute;
            top: 100px;
            left: 100px;
            width: 37px;
            height: 42px;
            border: 1px solid #000;
            background-image: url(images/jinglingtu.jpeg);
            background-position: -376px 0px;
          }
        </style>
      </head>
      <body>
        <i ></i>
      </body>
    </html>
    

background 合寫屬性

可以使用 background 屬性來同時設定背景顏色、背景圖片、背景位置、背景大小等屬性,

語法

selector {
  background: color url(image.jpg) no-repeat center center / cover;
}

示例

例如將背景顏色設定為黃色,背景圖片為 01.jpg ,不重復,居中對齊 ,


background: yellow    url(image/01.jpg) no-repeat center center 
            背景顏色   背景圖片           背景重復  背景位置
<style>.zstitle { width: 280px; text-align: center; font-size: 26px } .zsimgweixin { width: 280px } .zsimgali { width: 280px; padding: 0px 0px 50px 0px } .zsleft { float: left } .zsdiv { display: flex } .zs { font-size: 30px } .zspaddingright { padding: 0px 100px 0px 0px }</style> 請關于一下啦^_^

微信公眾號

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/556343.html

標籤:Html/Css

上一篇:京東到家小程式-在性能及多端能力的探索實踐

下一篇:返回列表

標籤雲
其他(161880) Python(38266) JavaScript(25516) Java(18284) C(15238) 區塊鏈(8274) C#(7972) AI(7469) 爪哇(7425) MySQL(7273) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5876) 数组(5741) R(5409) Linux(5347) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4609) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2438) ASP.NET(2404) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) .NET技术(1985) HtmlCss(1979) 功能(1967) Web開發(1951) C++(1942) python-3.x(1918) 弹簧靴(1913) xml(1889) PostgreSQL(1881) .NETCore(1863) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • IEEE1588PTP在數字化變電站時鐘同步方面的應用

    IEEE1588ptp在數字化變電站時鐘同步方面的應用 京準電子科技官微——ahjzsz 一、電力系統時間同步基本概況 隨著對IEC 61850標準研究的不斷深入,國內外學者提出基于IEC61850通信標準體系建設數字化變電站的發展思路。數字化變電站與常規變電站的顯著區別在于程序層傳統的電流/電壓互 ......

    uj5u.com 2020-09-10 03:51:52 more
  • HTTP request smuggling CL.TE

    CL.TE 簡介 前端通過Content-Length處理請求,通過反向代理或者負載均衡將請求轉發到后端,后端Transfer-Encoding優先級較高,以TE處理請求造成安全問題。 檢測 發送如下資料包 POST / HTTP/1.1 Host: ac391f7e1e9af821806e890 ......

    uj5u.com 2020-09-10 03:52:11 more
  • 網路滲透資料大全單——漏洞庫篇

    網路滲透資料大全單——漏洞庫篇漏洞庫 NVD ——美國國家漏洞庫 →http://nvd.nist.gov/。 CERT ——美國國家應急回應中心 →https://www.us-cert.gov/ OSVDB ——開源漏洞庫 →http://osvdb.org Bugtraq ——賽門鐵克 →ht ......

    uj5u.com 2020-09-10 03:52:15 more
  • 京準講述NTP時鐘服務器應用及原理

    京準講述NTP時鐘服務器應用及原理京準講述NTP時鐘服務器應用及原理 安徽京準電子科技官微——ahjzsz 北斗授時原理 授時是指接識訓通過某種方式獲得本地時間與北斗標準時間的鐘差,然后調整本地時鐘使時差控制在一定的精度范圍內。 衛星導航系統通常由三部分組成:導航授時衛星、地面檢測校正維護系統和用戶 ......

    uj5u.com 2020-09-10 03:52:25 more
  • 利用北斗衛星系統設計NTP網路時間服務器

    利用北斗衛星系統設計NTP網路時間服務器 利用北斗衛星系統設計NTP網路時間服務器 安徽京準電子科技官微——ahjzsz 概述 NTP網路時間服務器是一款支持NTP和SNTP網路時間同步協議,高精度、大容量、高品質的高科技時鐘產品。 NTP網路時間服務器設備采用冗余架構設計,高精度時鐘直接來源于北斗 ......

    uj5u.com 2020-09-10 03:52:35 more
  • 詳細解讀電力系統各種對時方式

    詳細解讀電力系統各種對時方式 詳細解讀電力系統各種對時方式 安徽京準電子科技官微——ahjzsz,更多資料請添加VX 衛星同步時鐘是我京準公司開發研制的應用衛星授時時技術的標準時間顯示和發送的裝置,該裝置以M國全球定位系統(GLOBAL POSITIONING SYSTEM,縮寫為GPS)或者我國北 ......

    uj5u.com 2020-09-10 03:52:45 more
  • 如何保證外包團隊接入企業內網安全

    不管企業規模的大小,只要企業想省錢,那么企業的某些服務就一定會采用外包的形式,然而看似美好又經濟的策略,其實也有不好的一面。下面我通過安全的角度來聊聊使用外包團的安全隱患問題。 先看看什么服務會使用外包的,最常見的就是話務/客服這種需要大量重復性、無技術性的服務,或者是一些銷售外包、特殊的職能外包等 ......

    uj5u.com 2020-09-10 03:52:57 more
  • PHP漏洞之【整型數字型SQL注入】

    0x01 什么是SQL注入 SQL是一種注入攻擊,通過前端帶入后端資料庫進行惡意的SQL陳述句查詢。 0x02 SQL整型注入原理 SQL注入一般發生在動態網站URL地址里,當然也會發生在其它地發,如登錄框等等也會存在注入,只要是和資料庫打交道的地方都有可能存在。 如這里http://192.168. ......

    uj5u.com 2020-09-10 03:55:40 more
  • [GXYCTF2019]禁止套娃

    git泄露獲取原始碼 使用GET傳參,引數為exp 經過三層過濾執行 第一層過濾偽協議,第二層過濾帶引數的函式,第三層過濾一些函式 preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp'] (?R)參考當前正則運算式,相當于匹配函式里的引數 因此傳遞 ......

    uj5u.com 2020-09-10 03:56:07 more
  • 等保2.0實施流程

    流程 結論 ......

    uj5u.com 2020-09-10 03:56:16 more
最新发布
  • CSS基礎-背景

    # 背景 ### **background-color** 背景顏色, 可以使用十六進制、rgb、rgba表示。 **語法** ```css /**selector 背景元素的原則去*/ /** color 背景顏色的值, 可以是 顏色名稱、十六進制值、RGB、RGBA*/ selector { b ......

    uj5u.com 2023-06-30 08:20:28 more
  • 京東到家小程式-在性能及多端能力的探索實踐

    為了提高研發效率,經過技術選型采用了taro3+原生混合開發模式,本文主要講解我們是如何基于taro框架,進行多端能力的探索和性能優化。 ......

    uj5u.com 2023-06-30 08:20:15 more
  • 初入前端-HTML

    ## HTML ### HTML歷史 HTML(Hypertext Markup Language)的歷史可以追溯到上世紀90年代初,以下是HTML的主要歷史階段: 1. HTML 1.0:在1991年發布,是HTML的最初版本,用于創建基本的文本和鏈接結構,但功能有限。 2. HTML 2.0:于 ......

    uj5u.com 2023-06-30 08:20:10 more
  • 圖書商城Vue+Element+Node專案練習(...)

    本系列文章是為學習Vue的專案練習筆記,盡量詳細記錄一下一個完整專案的開發程序。面向初學者,本人也是初學者,搬磚技識訓不成熟。專案在技術上前端為主,包含一些后端代碼,從基礎的資料庫(Sqlite)、到后端服務Node.js(Express),再到Web端的Vue,包含服務端、管理后臺、商城網站、小程... ......

    uj5u.com 2023-06-29 08:54:51 more
  • 記錄--不定高度展開收起影片 css/js 實作

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 不定高度展開收起影片 最近在做需求的時候,遇見了元素高度展開收起的影片需求,一開始是想到了使用 transition: all .3s; 來做影片效果,在固定高度的情況下,transition 影片很好使,滿足了需求,但是如果要考慮之后可 ......

    uj5u.com 2023-06-29 08:54:35 more
  • 前端打包部署后介面BASE_URL不對問題解決辦法

    在前端打包部署時,為了免去不同環境打包的麻煩,專案用的流水線觸發方式。在這里不細說,重點說說下面情況。 當專案提交打包部署后,訪問壓測環境或者生產環境的地址來使用專案時,發現介面報錯404。 在NETWORK里發現介面的BASEURL和當前環境需要呼叫的后端baseurl不同。 主要問題在于配置問題 ......

    uj5u.com 2023-06-29 08:54:22 more
  • this指向性問題

    this的查找規則會逐層往上查找,最終位全域window 優先級問題:顯式系結(顯式系結與new系結沒有可比性)new系結>隱式系結>默認系結 在編程中,this 是一個關鍵字,代表當前物件或者函式的執行環境。this 的指向性問題是指在不同的情況下,this 指向的物件不同,從而影響代碼的行為。 ......

    uj5u.com 2023-06-29 08:54:12 more
  • this指向性問題

    this的查找規則會逐層往上查找,最終位全域window 優先級問題:顯式系結(顯式系結與new系結沒有可比性)new系結>隱式系結>默認系結 在編程中,this 是一個關鍵字,代表當前物件或者函式的執行環境。this 的指向性問題是指在不同的情況下,this 指向的物件不同,從而影響代碼的行為。 ......

    uj5u.com 2023-06-29 08:48:10 more
  • Vue2.0針對設備調節顯示內容方法

    一晚上完成0.2.2、0.3.0、0.3.1三個版本的更新,很高興,總結一下 專案地址: [穆音博客](https://blog.muvocal.com) 文章首發地址:[Vue針對設備調節顯示](https://blog.muvocal.com/blog/11) ## Vue中進行優化的方式 總體 ......

    uj5u.com 2023-06-28 10:04:15 more
  • React ISR 如何實作 - 最后的 Demo

    之前寫了兩個 `demo` 講解了如何實作 `SSR` 和 `SSG`,今天再寫個 `demo` 說在 `ISR` 如何實作。 ## 什么是 ISR `ISR` 即 `Incremental Static Regeneration` 增量靜態再生,是指在 `SSG` 的前提下,可以在收到請求時判定頁 ......

    uj5u.com 2023-06-28 10:04:10 more