78.纯 CSS 创作 Windows 启动界面

博客分享了学习资源,包含原文地址、学习后效果地址,还给出了HTML和CSS代码,转载自其他博客。主要涉及前端开发中HTML和CSS相关内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文地址:https://segmentfault.com/a/1190000015632759

学习后效果地址:https://scrimba.com/c/cPgWmZCg

HTML code:

<!--windows-boot : windows 启动-->
<div class="windows-boot">
    <div class="logo">
        <p class="ms">Microsoft</p>
        <p class="win">Windows</p>
        <p class="pro">Professional</p>
    </div>
    <div class="bar"></div>
</div>

CSS code:

html, body,.logo p{
    margin: 0;
    padding: 0;
}
body{
    height: 100vh;
    /* 设置body的子元素水平垂直居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    color: white;
    
}
.windows-boot{
    font-size: 15px;
    width: 21.5em;
    height: 15em;
    /* border: 1px dashed white; */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}
.logo{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.logo p{
    margin: 0.1em 0;
    font-family: sans-serif;
}
.logo .ms{
    font-size: 1.6em;
    font-weight: lighter;
    line-height: 1em;
}
.logo .ms::after {
    content: '\00a9';
    font-size: 0.625em;
    vertical-align: top;
    position: relative;
    top: -0.3em;
    left: 0.2em;
}
.logo .win{
    font-size: 4.2em;
    font-weight: bold;
    line-height: 86%;
}
.logo .win sup{
    color:red;
}
/* 用页面中的<sup>xp<sup>代替以下 
.logo .win::after {
    content: 'XP';
    font-size: 0.5em;
    vertical-align: top;
    position: relative;
    top: -0.4em;
    color: tomato;
}
*/
.logo .pro{
    font-size: 3em;
    /* lighter: 清晰的 */
    font-weight: lighter;
    line-height: 1em;
    padding-left: 0.2em;
}
/* 定义进度条 */
.bar{
    width: 15em;
    height: 1em;
    /* 银色 */
    border: 0.2em solid silver;
    border-radius: 0.7em;
    position: relative;
    padding: 0.2em;
     overflow: hidden;
}
/* 利用:::before制作蓝条 */
.bar::before {
    content: '';
    position: absolute;
    width: 3em;
    height: 70%;
    border-radius: 0.2em;
    background: 
        linear-gradient(
            to right,
            transparent 30%,
            black 30%, black 35%,
            transparent 35%, transparent 65%,
            black 65%, black 70%,
            transparent 70%
        ),
        linear-gradient(
            blue 0%,
            royalblue 17%,
            deepskyblue 32%, deepskyblue 45%,
            royalblue 60%,
            blue 100%
        );
    filter: brightness(1.2);
    animation: run 2s linear infinite;
}
/* 定义动画 */
@keyframes run {
    from {
        transform: translateX(-3em);
    }

    to {
        transform: translateX(15em);
    }
}

 

posted on 2019-06-19 23:08 人生与戏 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/FlyingLiao/p/11055609.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值