用 css 將元素置中 紅色死神 發表於 2013年7月4日 星期四 7月 04, 2013 / 沒有留言 標籤 css, css3 Centering Percentage Width/Height Elements 要讓類似 dialog 的彈出 div 在頁面置中的小技巧。 view plaincopy to clipboardprint.center { position: absolute; left: 50%; top: 50%; /* Nope =( margin-left: -25%; margin-top: -25%; */ /* Yep! */ transform: translate(-50%, -50%); width: 40%; height: 50%; } 以電子郵件傳送這篇文章BlogThis!分享至 Twitter分享至 Facebook
0 意見:
張貼留言