Home > Web Front-end > HTML Tutorial > 边框相对于内容的属性怎么写?_html/css_WEB-ITnose

边框相对于内容的属性怎么写?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:31:16
Original
1234 people have browsed it

<div style="width:30px;height:30px;padding:30px;border:1px solid #ddd;">123</div>
Copy after login

如上所示,正常边框(border)会在内边框(padding)之外,我想要的是在内边框之内,就是30px宽高位置显示边框。好像有个属性可以设置的。


回复讨论(解决方案)

padding改成margin

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