div+css实现列表网格布局切换效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css实现列表网格布局切换效果代码,列表可切换成网格和横向列表两种布局模式。

代码标签: div css 列表 网格 布局 切换

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

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

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

  
  
  
  
<style>
* {
	transform-style: preserve-3d;
	box-sizing: border-box;
}
		
body {
	margin: 0;
	padding: 0;
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	perspective: 100vmin;
    background: #303030;
	overflow-x: hidden;
}

.button {
	width: 20vmin;
    height: 9vmin;
    background: #303030;
    display: flex;
    align-items: center;
    justify-content: center;
	border-radius: 3px;
	position: absolute;
	top: 11vmin;
}

.base {
    width: 17.5vmin;
    background: #00000066;
    height: 6.5vmin;
    border-radius: 4px;
    padding: 0.75vmin 0.5vmin 0.5vmin 0.125vmin;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444;
    border-color: #000 #444 #444 #000;
}

#list-grid:checked ~ .button .base {
    padding: 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0