博主信息
博文 12
粉丝 0
评论 0
访问量 11406
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
4-2css中的框模型简介
PHP全栈60天VIP大牛作业题
原创
898人浏览过
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>框模型</title>
  <style>
  .box {
    /*设置宽和高*/
    width:500px;
    height:400px;
    background-color:yellow;/*背景颜色*/
    /*display: block;*/
    text-align: center;/*水平居中*/
    display: table-cell;/*将块显示方式转化单元格方式*/
    vertical-align: middle;/*垂直居中*/
/*设置顶边框*/
border-top-width: 10px;
border-top-style: dotted;/*虚线*/
border-top-color: coral;
/*右边框 */
border-right-width: 10px;
border-right-style: solid;/*实线*/
border-right-color: green;
/*border-right:10px solid red;简写*/
/*下边框*/
border-bottom-width: 10px;
border-bottom-style: solid;/*实线*/
border-bottom-color: blue;
/*下左框*/
border-left-width: 10px;
border-left-style: solid;/*实线*/
border-left-color: blue;
/*设置内边柜*/
  display: block;/*重新把块显示为块样式*/
padding-top: 30px;
padding-right: 50px;
padding-left: 30px;
padding-bottom: 60px;
/*padding:30px 简写*/
/*padding:30px 50px 60px当左右相等时可以简写*/
 /*padding:30px 50px 当上下左右相等时简写*/

 /*设置外边柜*/
 margin-top: 30px;
 margin-right: 50px;
 margin-left: 30px;
 margin-bottom: 60px;
 /*margin:30px 50px 60px 30px 上 右 下 左*/
 /*margin:30px 简写*/
 /*margin:30px 50px 60px当左右相等时可以简写*/
  /*margin:30px 50px 当上下左右相等时简写*/
  }

  </style>
</head>
<body>
  <div>
    <img src="147.jpg" alt=""width="300">
</body>
</html>


本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学