react笔记之学习日历样式的设置

1 篇文章 0 订阅

主界面

import ReactDOM from react-dom/client;
// 引入样式表
import ./index.css;

// 创建一个React元素
const App =


{/* 日志项容器 /}

{/ 日期的容器 */}


四月


19

    {/* 日志内容的容器 */}
    <div className="content">
        <h2 className="desc">学习React</h2>
        <div className="time">40分钟</div>
    </div>
</div>
;

// 获取根元素
const root = ReactDOM.createRoot(document.getElementById(root));
// 渲染元素
root.render(App);
样式文件

/设置基本样式/
*{
box-sizing: border-box;
}

/设置body的样式/
body{
background-color: #DFDFDF;
margin: 0;
}

/设置外层容器logs的样式/
.logs{
width: 800px;
margin: 50px auto;
padding: 20px;
background-color: #EAE2B7;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,.2);
}

/设置item的样式/
.item{
/开启弹性盒/
display: flex;
margin: 16px 0;
padding: 6px;
background-color: #FCBF49;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,.2);
}

/设置日期的样式/
.date{
width: 90px;
background-color: #fff;
border-radius: 10px;
font-weight: bold;
text-align: center;
overflow: hidden;
}

/设置月份效果/
.month{
height: 30px;
line-height: 30px;
font-size: 20px;
color: #fff;
background-color: #D62828;
}

/设置日期的效果/
.day{
height: 60px;
line-height: 60px;
font-size: 50px;
}

/设置日志内容的样式/
.content{
flex: auto;
text-align: center;
font-weight: bold;
}

/设置描述内容/
.desc{
font-size: 16px;
color: #194B49;
}

/设置学习时间/
.time{
color: #D62828;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

日霄科技

感谢各位大佬,您鼓励是我的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值