css+div布局实现图文博客文章折叠效果代码

代码语言:html

所属分类:布局界面

代码描述:css+div布局实现图文博客文章折叠效果代码

代码标签: css div 布局 图文 博客 文章 折叠

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.cdnfonts.com/css/satoshi");
* {
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	scroll-behavior: smooth;
}
html,
body {
	min-height: 100%;
}

body {
	margin: 0;
	font-family: "Satoshi", sans-serif, monospace;
	color: #eee;
	font-size: 18px;
	line-height: 161.8%;
	background: #212431;
	interpolate-size: allow-keywords;
}

::-webkit-scrollbar {
	width: 14px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: #ea5c1f;
	border: 4px solid #212431;
	cursor: pointer;
}
::-webkit-scrollbar-thumb:hover {
	background: #ea5c1f77;
}

body :is(h1, h2) {
	color: #ea5c1f;
	width: fit-content;
}
body h1 {
	font-size: 1.8em;
}
article {
	max-width: 618px;
	padding: 8px 24px;
	margin: auto;
	margin-top: 100px;
	margin-bottom: 100px;
	font-weight: 100;
	position: relative;
	overflow: hidden;

	border-bottom: 4px solid #d6d7d711;
	border-left: 4px solid #d6d7d711;

	background: linear-gradient(90deg, #46506433 0%, #4f5d7533);
	border-top-right-radius: 64px;
}
article aside {
	border-left: 4px solid #ea5c1f;
	padding-left: 16px;
	margin-bottom: 16px;
	line-height: 124%;
}
article strong {
	font-weight: 600;
}
article a {
	font-weight: 500;
	color: #ea5c1f;
	text-decoration: none;
	cursor: pointer;
}
article a:hover {
	text-decoration: underline;
}
article .foot {
	display: flex;
	gap: 24px;
	align-items: center;
	flex-wrap: wrap;
	padding-bottom: 16px;
}
article .foot img {
	max-width: 84px;
	height: fit-content;
	border: 4px solid #f5f5f5;
	border-top-color: #ea5c1f;
	border-right-color: #ea5c1f;
	object-fit: contain;
}
article .author a {
	font-weight: 600;
}
article .author span {
	font-size: 1.4em;
	padding-right: 2px;
	translate: 0 2px;
	rotate: -33deg;
	display: inline-block;
	color: #eec7b7;
	transition: all 0.2s ease-in-out;
}
article .author a:hover,
article .author a:hover span {
	color: #ea5c1f;
	rotate: 0deg;
}

.featured-image {
	width: 100%;
	height: 324px;
	background: url("//repo.bfw.wiki/random/600x400/景色");
	background-size: cover;
	background-position: 50% 16.18%;
	margin-top: 16px;
	border-top-right-radius: 42px;
	border-bottom: 4px solid #ea5c1f;
	position: relative;
	z-index: 1;
}
.featured-image .expand {
	position: absolute;
	right: 0px;
	bottom: -4px;
	color: #fff;
	cursor: pointer;
	background: #292f3e;
	border-top-left-radius.........完整代码请登录后点击上方下载按钮下载查看

网友评论0