边框样式+文字样式

边框样式

  1. 边框样式的属性
    设置边框的属性有
    border-color 定义边框颜色
    border-width 定义边框大小
    border-style 定义边框样式
    border-left 定义左边框
    border-right 定义右边框
    border-top 定义上边框
    border-bottom 定义下边框
    边框样式有实线(solid)虚线(dashed)点线(dotted)

语法格式

<-----<div style=”width:xxxpx; height:xxxpx:
background-color:#00f(蓝色) border-right-color:red(红色)
border-right-width:5px(任意值) boredr-right-style:solid;(实线)”>
这是定义啦右边框为红色,右边框宽度为5px,边框样式为实线,背景为蓝色。---->

<!DOCTYPE html>
<html lang="en">
<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>
</head>
<body>
    <div style="width: 400px; height: 200px; 
    background-color: #00f; border-width: 5px; 
    border-style: solid;"></div>
    <div style="width: 400px; height: 200px;
    background-color: burlywood; border-width: 10px;
    border-style: dashed;"></div>
    <div style="width: 400px; height: 200px;
    background-color:cornsilk; border-widht;10px
    border-style: dotted; "></div>
    <div style="width: 400px; height: 200px;
     background-color: red; border-right-color: yellow;
     border-right-width: 10px; border-right-style: solid;"></div>
</body>
</html>

文字样式

  1. 文字样式的属性
    设置文字样式的属性有
    font-family 定义字体类型
    font-size 定义字体大小
    font-weight 定义字体粗细
    font-style 定义字体样式
    color 定义字体颜色

语法规则

 <p style=”font-family:FangSong ;></p>  定义仿宋字体
 <p style=”font-size:small’”></p>   定义字体small字体大小
<p style=”font-weight:normal;></p> 定义正常体粗细
<p style=”font-style:italic;></p>  定义字体样式为斜体
<p style=”color:#00ff00”></p>    定义字体颜色为绿色

**

<!DOCTYPE html>
<html lang="en">
<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>
</head>
<body>
    <p>我是默认 默认宋体</p>
    <p style="font-family:KaiTi,FangSong,'SimSun';">这是一段文字</p>
    <p style="font-family:KaiTi;">我是楷体</p>
    <p style="font-family: FangSong;">我是仿宋</p>
    <p style="font-family: SinSun;">我是黑体(默认)</p>
    <p style="font-size: small;">设置small大小的字体</p>
    <p style="font-size: meidium;">设置正常大小的字体</p>
    <p style="font-size: large;">设置large大小的字体</p>
    <p style="font-weight: normal;">我是正常体(默认)</p>
    <p style="font-weight: lighter;">较细</p>
    <p style="font-weight: bold;">较粗</p>
    <p style="font-weight: bolder;">很粗</p>
    <p style="font-style: normal;">设置正常样式的字体(默认)</p>
    <p style="font-style: italic;">设置斜体样式的字体</p>
    <p style="font-style: oblique;">设置斜体样式的字体</p>
    <p style="color: red;">设置红色字体</p>
    <p style="color: #00ff00;">设置绿色字体</p>
    <p style="color: rgb(0,0,255);"></p>
</body>
</html>
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值