当前位置: 首页 > news >正文

网页制作11-html,css,javascript初认识のCCS样式列表(下)

六、外边距,内边距,边框属性

盒子模型:

1、外边距:margin

img{
            margin:40px 30px 10px 20px;
        }/*外边距复合属性:上右下左*/

2、内边距

body{
            padding:10px 20px 40px 30px;
        }/*内边距复合属性:上右下左*/

3、边框

1)边框样式

取值 含义
none 默认值无边框

 dotted

点线边框
dashed 虚线边框
solid 实线边框
double 双实线边框
groove 边框具有立体感的沟槽
ridge 边框长脊形
inset 使整个边框凹陷
outset 使整个边框凸起

.b{
            border-top-style: dashed;
            border-right-style: solid;
            border-left-style: double;
            border-bottom-style: groove;
            line-height: 20px;
        }

 效果图如下:

2)边框宽度 border-width

medium 默认宽度
thin 小于默认宽度
thick 大于默认宽度

border-top-width:上

border-right-width: 右;
border-left-width:左;
border-bottom-width: 下;

综合:border-width: 3px 3px 4px 9px;

3) 边框颜色:border-color:

border-color:red yellow blue green;综合

border-top-color:black;上

border-right-color: 右;
border-left-color:左;
border-bottom-color: 下;

4)边框属性综合border(分方向综合合并宽度,样式和颜色)

border-top:2px dasher black; 

border-right: 2px dasher black; 
border-left:2px dasher black; 
border-bottom: 2px dasher black; 

<style type="text/css">
		.img1{
			margin:10px 30px 10px 90px;
		}/*外边距复合属性:上右下左*/
		body{
			padding:10px 20px 40px 30px;
		}
		.b{font-size: 30px;
			border-top-style: dashed;
			border-right-style: solid;
			border-left-style: double;
			border-bottom-style: groove;
			line-height: 49px;
			border-width: 2px;
			border-color:red yellow blue green;
		}/*盒子模型*/
		
		.d{position: absolute;
		top:5%;
		left:20%;
		margin:5px;/*绝对定位*/
		z-index: -1;}/*置于最底层*/
		
		
	</style>
</head>

<body>
	<img src="bottle.jpg" width="400" align="left" class="img1" alt=""/><!--元素定位-->
	<span class="b"><!--边框样式,颜色,宽度设置-->
	1、The art of living is to know when to hold fast and when to let go. For life is a paradox: it enjoins us to cling to its many gifts even while it ordains their eventual relinquishment.

  The rabbis of old put it this way: “A man comes to this world with his fist clenched, but when he dies, his hand is open.”

  生活的艺术在于懂得什么时候追求,什么时候放弃。因为生活就是一个矛盾体:它要我们紧紧抓住它赐予我们的生命之礼,然后最终又让它们从我们手中跑掉。

  老先生们说:“人们紧握着拳头来到这个世界上,离开这个世界时却摊开了双手。”

  Surely we ought to hold fast to life, for it is wondrous, and full of a beauty that breaks through every pore of God’s own earth.

  We know that this is so, but all too often we recognize this truth only in our backward glance when we remember what was and then suddenly realize that it is no more.

  当然我们应该紧紧把握生活,因为它美妙得不可思议,充满了从上帝的每个毛孔里蹦出来的美。

  我们都清楚这一点,但我们常常只有在回首往事时才会想去过去,才会突然意识到过去永远地消逝了,才会承认这个道理。
	(from:网络,《生活的艺术(The art of living)》)</span><hr/>
	
	<img src="firework.png" class="d" alt=""><!--绝对定位-->
	</body>
</html>

七、定位属性

1、语法表

相关文章:

  • SD-WAN解决方案架构(SD WAN Solution Architecture)
  • 如何确保爬虫遵守1688的使用协议
  • HTML——标题标签与段落标签
  • Mac安装jdk教程
  • JavaWeb6、Servlet
  • Android 低功率蓝牙之BluetoothGattCallback回调方法详解
  • Android 低功率蓝牙之BluetoothGattCharacteristic详解
  • 极狐GitLab 17.9 正式发布,40+ DevSecOps 重点功能解读【一】
  • “深入浅出”系列之Linux篇:(12)C++网络编程
  • nvm 让 Node.js 版本切换更灵活
  • 记录一些面试遇到的问题
  • Linux系统之配置HAProxy负载均衡服务器
  • powermock,mock使用笔记
  • 重生之我在 CSDN 学习 KMP 算法
  • Linux——Docker容器内MySQL密码忘记了如何查看
  • 信息管理之信息的萃取方法--使用渐进归纳法逐步提取高可见性笔记
  • os-copilot安装和使用体验测评
  • PHP 矩形面积和周长的程序(Program for Area And Perimeter Of Rectangle)
  • 前端网络安全面试题及答案
  • MATLAB实现遗传算法优化风电_光伏_光热_储热优化
  • 玛丽亚·凯莉虹口连唱两夜,舞台绽放唤醒三代人青春记忆
  • 小米汽车回应部分SU7前保险杠形变
  • 国家防汛抗旱总指挥部对15个重点省份开展汛前实地督导检查
  • 中央军委决定调整组建3所军队院校
  • 秘鲁总统任命前司法部长阿拉纳为新总理
  • 7月纽约举办“上海日”,上海大剧院舞剧《白蛇》连演三场