九、Tailwind CSS基础学习笔记之 Tailwind CSS Object Position 定位

作者: 温新

分类: 【Tailwind CSS】

阅读: 1800

时间: 2022-07-17 14:43:01

hi,我是温新,一名PHPer

Object Position 定位,用于调整元素在容器中的位置。其类如下:

  • object-left-top 定位于左上角
  • object-top 定位于顶部
  • object-right-top 定位于右上角
  • object-left 定位于左边
  • object-center 居中定位
  • object-right 定位于右边
  • object-left-bottom 定位于左下角
  • object-bottom 底部定位
  • object-right-bottom 右下角定位
<span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important"><!doctype html></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">html</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">lang</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"en"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">head</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">meta</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">charset</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"UTF-8"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">meta</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">name</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"viewport"</span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">          <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">content</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span style="box-sizing: border-box"></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">link</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">href</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"../dist/mystyle.css"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">rel</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"stylesheet"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span class="cm-tag cm-bracket" style="box-sizing: border-box"></</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">head</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">body</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"text-center"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">h1</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"text-green-500 text-5xl font-bold"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span>Tailwind CSS Object Position<span class="cm-tag cm-bracket" style="box-sizing: border-box"></</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">h1</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">b</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span>Tailwind CSS Object Position Class<span class="cm-tag cm-bracket" style="box-sizing: border-box"></</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">b</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span style="box-sizing: border-box"></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">div</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"bg-green-300 mx-16 space-y-4 p-2 justify-between grid grid-rows-3 grid-flow-col"</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-left-top"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-left-top w-24 h-24 bg-green-200 border-4 my-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20220709/2022070933462.png"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-left"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-left w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20220212/2022021231094.png"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-left-bottom"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-left-bottom w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20220325/2022032548060.jpg"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-top"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-top w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20220626/2022062685467.jpg"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-center"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-center w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20210208/2021020810979.jpg"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-bottom"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-bottom w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20200927/2020092748411.jpg"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-right-top"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-right-top w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20200913/2020091366982.jpg"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-right"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-right w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20200910/2020091084447.jpg"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">        <span class="cm-tag cm-bracket" style="box-sizing: border-box"><</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">img</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">title</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-right-bottom"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">class</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"object-none object-right-bootom w-24 h-24 border-4"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">src</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">"https://www.ziruchu.com/uploads/article/20200518/2020051841739.png"</span> <span style="box-sizing: border-box;color: rgb(209, 154, 102) !important">alt</span>=<span style="box-sizing: border-box;color: rgb(152, 195, 121) !important">""</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px">    <span class="cm-tag cm-bracket" style="box-sizing: border-box"></</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">div</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span class="cm-tag cm-bracket" style="box-sizing: border-box"></</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">body</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span><br></br><span style="box-sizing: border-box;color: rgb(171, 178, 191);padding-right: 0.1px"><span class="cm-tag cm-bracket" style="box-sizing: border-box"></</span><span style="box-sizing: border-box;color: rgb(224, 108, 117) !important">html</span><span class="cm-tag cm-bracket" style="box-sizing: border-box">></span></span>
请登录后再评论