奶头挺立呻吟高潮av全片,成人试看120秒体验区,性欧美极品v,A片高潮抽搐揉捏奶头视频

網(wǎng)頁設(shè)計(jì)

html元素水平居中的方法

時間:2025-04-25 11:27:00 網(wǎng)頁設(shè)計(jì) 我要投稿
  • 相關(guān)推薦

html元素水平居中的方法

  html元素有哪些?水平居中于其父級元素的方法你是否知道呢?就讓小編來告訴你們哦!

  方法1:

  代碼如下:

  <p class="wrap">

  <p class="left-right-middle1">左右居中方法1</p>

  </p>

  代碼如下:

  html,body,p{

  margin:0;

  padding:0;

  height:100%;

  position:relative;

  }

  .wrap{

  width:400px;

  height:300px;

  margin:10px;

  border:1px solid #000;

  }

  .left-right-middle1{

  width:200px;

  background-color:#69F;

  margin:0 auto;

  }

  方法2:

  代碼如下:

  <p class="wrap">

  <p class="left-right-middle2">左右居中方法2</p>

  </p>

  代碼如下:

  html,body,p{

  margin:0;

  padding:0;

  height:100%;

  position:relative;

  }

  .wrap{

  width:400px;

  height:300px;

  margin:10px;

  border:1px solid #000;

  }

  .left-right-middle2{

  width:200px;

  background-color:#69F;

  left:50%;

  margin-left:-100px;

  }

  html元素 垂直居中 于 其父級元素的方法:

  代碼如下:

  <p class="wrap">

  <p class="top-bottom-middle">上下居中</p>

  </p>

  代碼如下:

  html,body,p{

  margin:0;

  padding:0;

  height:100%;

  position:relative;

  }

  .wrap{

  width:400px;

  height:300px;

  margin:10px;

  border:1px solid #000;

  }

  .top-bottom-middle{

  height:200px;

  background-color:#69F;

  top:50%;

  margin-top:-100px;

  }

  html元素 水平垂直居中 于 其父級元素的方法:

  方法1:

  代碼如下:

  <p class="wrap">

  <p class="all-middle1">上下左右居中方法1</p>

  </p>

  代碼如下:

  html,body,p{

  margin:0;

  padding:0;

  height:100%;

  position:relative;

  }

  .wrap{

  width:400px;

  height:300px;

  margin:10px;

  border:1px solid #000;

  }

  .all-middle1{

  width:200px;

  height:200px;

  background-color:#69F;

  top:50%;

  margin:-100px auto 0;

  }

  方法2:

  代碼如下:

  <p class="wrap">

  <p class="all-middle2">上下左右居中方法2</p>

  </p>

  代碼如下:

  html,body,p{

  margin:0;

  padding:0;

  height:100%;

  position:relative;

  }

  .wrap{

  width:400px;

  height:300px;

  margin:10px;

  border:1px solid #000;

  }

  .all-middle2{

  width:200px;

  height:200px;

  background-color:#69F;

  top:50%;

  left:50%;

  margin:-100px 0 0 -100px;

  }

  完整代碼:

  代碼如下:

  <!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">

  <head>

  <meta http-equiv="Content-Type" content="text/html" charset="utf-8" />

  <title>p Middle</title>

  <style type="text/css">

  html,body,p{

  margin:0;

  padding:0;

  height:100%;

  position:relative;

  }

  .wrap{

  width:400px;

  height:300px;

  margin:10px;

  border:1px solid #000;

  }

  .left-right-middle1{

  width:200px;

  background-color:#69F;

  margin:0 auto;

  }

  .left-right-middle2{

  width:200px;

  background-color:#69F;

  left:50%;

  margin-left:-100px;

【html元素水平居中的方法】相關(guān)文章:

CSS居中浮動元素的使用方法05-31

div水平垂直居中顯示01-19

CSS 如何使p層水平居中04-28

用CSS讓DIV層水平居中實(shí)例05-16

用CSS讓p層水平居中實(shí)例04-08

html5的canvas方法使用01-19

HTML5學(xué)習(xí)方法05-02

php過濾危險(xiǎn)html代碼的方法05-31

html5的學(xué)習(xí)方法指導(dǎo)03-01

主站蜘蛛池模板: 都兰县| 淄博市| 怀化市| 中卫市| 沁阳市| 错那县| 繁昌县| 孝昌县| 雷山县| 加查县| 贺兰县| 晋宁县| 永昌县| 金昌市| 黑水县| 华宁县| 绵阳市| 博罗县| 濮阳县| 建平县| 汾西县| 昔阳县| 嘉义县| 米脂县| 永寿县| 松潘县| 义乌市| 邯郸县| 友谊县| 延庆县| 韩城市| 周口市| 新干县| 汉沽区| 临湘市| 广丰县| 保德县| 易门县| 阿拉善盟| 崇文区| 北碚区|