Home > Web Front-end > HTML Tutorial > 这个padding为何不起作用?_html/css_WEB-ITnose

这个padding为何不起作用?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:27:45
Original
1468 people have browsed it

我希望产生这样的效果,


代码如下







    

      
box1

    





得到 这样的效果



请问 ,应当 如何修改?


回复讨论(解决方案)


div.father {
  border: 1px solid black;
  align-items: center;
  justify-content: center;
  display: flex;
  height: 300px;
  width: 300px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
div.son {text-align:right;
  padding: 20px 20px 0 0;
  border: 1px solid black;
  height: 100px;
  width: 100px;
}







    

      
box1

    



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template