首页 > 其他分享 >简易博客页面小项目 html css

简易博客页面小项目 html css

时间:2022-12-03 14:27:03浏览次数:47  
标签:box right blog html 10px left margin css 页面

项目预览

image

代码

html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" type="text/css" href="myblog.css">


</head>
<body>

<div class="blog-left">
    <div class="blog-avatar">
        <img alt="avatar-img" class="avatar-img" src="mlq.png">
    </div>
    <div class="blog-title">passion</div>
    <div class="blog-info">这个人很帅什么都没有留下</div>
    <div class="blog-link">
        <ul class="blog-link-title">
            <li>关于我</li>
            <li>微博号</li>
            <li>公众号</li>
        </ul>
    </div>
    <div class="blog-tag">
        <ul class="blog-tag-title">
            <li>#python</li>
            <li>#golang</li>
            <li>#javascript</li>
        </ul>
    </div>
</div>

<div class="blog-right">
    <div class="blog-list ">
        <div class="blog-box clearfix">  <!-- 防止塌陷 用伪类选择器(:after) 创造的空文本填充盒子-->
            <span class="blog-box-title">论发财之道</span>
            <span class="blog-box-time">2022-12-1</span>
        </div>
        <div class="blog-info">
            <span class="blog-info-text">身体好、吃苦耐劳、坚韧不拔、软饭硬吃、你还在等什么 赶紧找xxx报名</span>
        </div>
        <div class="blog-tag-list">
            <span class="blog-tag-content">#重金求子</span>
            <span class="blog-tag-content">#全国可飞</span>
        </div>
    </div>
    <!-- blog-list 可以多复制几个 -->

</div>
</body>
</html>

css:

/* background style */
body{
    background-color: gray;
    margin: 0;
    height : 1200px;
    font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif;
    /* font-family 属性应该设置几个字体名称作为一种"后备"机制,如果浏览器不支持第一种字体,他将尝试下一种字体。*/

}

/* left div box style */
.blog-left{
    float: left;
    width: 25%;
    height: 100%;
    background-color:darksalmon;
    position: fixed;
}

/* right div box style */
.blog-right{
    float: right;
    width: 75%;
    height: 100%;
}

/* general style */
a{
    text-decoration: none; /* remove the a tag underline */

}
ul{
    list-style-type: none; /* remove the ul tag default style */
    padding: 0;  /* ul tag default padding-left=40, remove it  */

}

/*avatar style */
.blog-left .blog-avatar{
    width: 100px;
    height: 100px;
    border: 8px outset white; /* border style is outset, don't forget set */
    border-radius: 50% ; /* this property will Controls the border of the image to be rounded */
    margin: 20px auto;  /* set the circle in div box middle */
    overflow: hidden;  /* Resolving image overflows problem, set the img in the circle */
}
/* solved overflow problem !!!! */
.clearfix:after {
            content: '';  /* 填充空字符串 不会触发浏览器优先选择文本的机制*/
            display: block;   /* 设置成块级标签 使其可以填充一整行 */
            clear: both;   /* 当其左右两端有浮空元素时 就继续往下找到一个没有浮空元素的位置 作为一个块进行填充*/
        }

.avatar-img{
    max-height: 100%; /* img is in the div box, set the max height=100% will cramming the div box  */
}

.blog-left .blog-title{
    margin-top:20px;
    margin-bottom:20px;
    text-align: center; /* set the position of the text in the div tag */
    font-weight: 900;  /* set the font of the text */
    font-size: 2em;
    color: #ff154c;
}
.blog-left .blog-link-title{
    margin: 60px auto;
}

.blog-left .blog-link-title li{
    margin: 10px auto;
    text-align: center;
}

.blog-left .blog-tag-title li{
    margin: 10px auto;
    text-align: center;
}
.blog-left div.blog-info{
    margin: 10px auto;
    text-align: center;
}

.blog-right .blog-list{
    background-color: gray;
    width : auto;
    height : 100px;
    margin : 40px 40px;
    border:5px solid coral;
    border-radius: 10px 10px 10px 10px;
    box-shadow: 10px 10px 10px rgba(255,127,80,0.8)  /* box-shadow style */;
}

.blog-right :hover{
    background-color: lightcoral;
}


.blog-right .blog-box span.blog-box-title {
    float: left;
}
.blog-right .blog-box span.blog-box-time {
    float: right;
}

.blog-right .blog-info {
    margin: 10px 10px;

}
.blog-right .blog-tag-list {
    margin: 10px 10px;
}

标签:box,right,blog,html,10px,left,margin,css,页面
From: https://www.cnblogs.com/passion2021/p/16947554.html

相关文章

  • qt中父子页面切换隐藏实现方法 (利用信号槽机制实现)
    首先既然你打开了这篇文章,那你一定想到过,将子界面作为父界面的一个属性来实现,但是这样父界面通知子界面会很轻松,但子界面通知父界面怎么搞呢?很显然不能再子界面再实例化父......
  • 查看前端页面调用接口及参数方法
    查看前端页面调用接口及参数方法依该页面的查询按钮为例(浏览器为Goole)  第一步:摁一下键盘上的F12①会看到调试信息框出现在了右边,由于屏幕的原因,让这个信息框在右边......
  • js向ul标签添加li并且li标签有修改删除按钮+js中添加颜色css样式(使用layui下拉)
    js向ul标签添加li并且li标签有修改删除按钮Layui当中的导航条动态添加效果:1、html放置ul标签<ulclass="layui-nav"id="nav"layui-filter="test"></ul>/2、js编......
  • 将html字符串转换成html标签显示到页面上(转)
    转自:将html字符串转换成html标签显示到页面上当我们将html字符串放到页面上时,是无法直接显示出我们想要的内容,这时我们需要将字符串转化成为html标签(必须保证html字符串的......
  • 5大CSS重点、难点、易错点总结,入门学前端必看
    最近跟粉丝同学反馈,CSS中知识点多,在学习过程中,学到后边忘记前面。有些相似的内容很容搞混,弄得自己学起来特别的吃力和头痛。要对这些容易搞混点的做好区分,最好的办法就是把......
  • 转 CSS居中布局
    底层原理   都是C语言。万物之主C语言。底层语言。 硬件C语言。 转  CSS居中布局https://blog.csdn.net/qq_27575925/article/details/111876431 ......
  • Centos7 安装wkhtmltopdf 提示缺少依赖库
    首先下载安装包:​​https://wkhtmltopdf.org/downloads.html​​,如果没有代理工具,下载会很慢。。。。。上传至服务器任意目录后,执行安装:​​rpm-ivhwkhtmltox-0.12.5-1.c......
  • vue scss样式预处理在 vscode 中起作用,但是报错
      2.在最外层级,输入代码  "files.associations":{"*.vue":"vue"} ......
  • 博客园页面定制CSS代码 教程
    花了一点时间修改自己的博客背景设置,现在分享一下代码。希望对大家有帮助。我的比较简单,主要代码模板来源于另外一个博主,然后我在基础上进行了部分修改。博主的连接:h......
  • CSS属性
    1.边框属性边框描述none无边框dotted点状虚线边框dashed矩形虚线边框solid实线边框1.黑色点状虚线边框 border:4pxdottedblack;2.黑色矩......