CSS揭秘,切圖

來源:互聯網
上載者:User
書中說道一個關鍵的點,視覺的錯覺:視覺的中點在偏上一點的位置(默默對自己說,不要用像素,別給自己挖坑。。。)

.center-display .object{  position: absolute;  width: 0.5em;  height: 0.5em;  top: 0;  bottom: 0.8em;  left: 0;  right: 0;  margin: auto auto;  border-radius: 50%;  background-color: red;text-indent: -300em;}.center-display:nth-child(2) .object{  bottom: 0;}

置中和偏上一點點的代碼,你能看出哪個是真真的放在中心嗎?

Get busy living, or get busy dying.

  • 相關文章

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.