MediaWiki:Gadget-Timeline.css

来自The Land of StarLight
Kesager留言 | 贡献2023年1月20日 (五) 19:00的版本 (创建页面,内容为“.tbui-timeline-container { margin: 0 auto; width: 100%; max-width: 768px; } .tbui-timeline-container::after { →‎clear:​ clear: both; display: table; content: ''; } .tbui-timeline { position: relative; →‎外层容器的上下外边距和内边距:​ margin-top: 2em; margin-bottom: 2em; padding: 2em 0; } .tbui-timeline::before { →‎时间线主体(竖线):​ position: absolute; top: 0; left: 18px; height: 100%; content: ''; /*配置…”
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
.tbui-timeline-container {
	margin: 0 auto;
	width: 100%;
	max-width: 768px;
}
 
.tbui-timeline-container::after {
  /* clear */
	clear: both;
	display: table;
	content: '';
}
.tbui-timeline {
	position: relative;
	/*外层容器的上下外边距和内边距*/
	margin-top: 2em;
	margin-bottom: 2em;
	padding: 2em 0;
}
 
.tbui-timeline::before {
  /* 时间线主体(竖线) */
	position: absolute;
	top: 0;
	left: 18px;
	height: 100%;
	content: '';
	/*配置主体时间线的宽度和颜色。*/
	background: #cccccc;
	width: 4px;
 
}
 
@media only screen and (min-width: 768px) {
/*双侧布局修正*/
	.tbui-timeline::before {
		left: 50%;
		margin-left: -2px;
	}
}
 
.tbui-timeline-item {
	position: relative;
	/*单个节点容器的外边距*/
	margin: 2em 0;
}
 
.tbui-timeline-item:after {
	clear: both;
	display: table;
	content: "";
}
 
.tbui-timeline-item:first-child {
	margin-top: 0;
}
 
.tbui-timeline-item:last-child {
	margin-bottom: 0;
}
.tbui-timeline-node {
	position: absolute;
	/*时间线上圆点的样式(窄屏)*/
	top: 12px;
	left: 10px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #cccccc;
	box-shadow: 0 0 0 2px #333333;
	color: #333333;
	vertical-align: middle;
	text-align: center;
	font-size: 14px;
	line-height: 20px;
}
 
@media only screen and (min-width: 768px) {
	.tbui-timeline-node {
		left: 50%;
		margin-left: -10px;
		/*时间线上圆点的样式(宽屏)*/
		top:5px;
	}
}
.tbui-timeline-content .tbui-timeline-more, .tbui-timeline-content .tbui-timeline-date {
	display: inline-block;
}
.tbui-timeline-content {
	position: relative;
	/*内容区域(窄屏)*/
	margin-left: 60px;
	padding: 1em;
	border:1px solid #CCCCCC;
	background: #f7f7f9;
}
.tbui-timeline-content:after {
	clear: both;
	display: table;
	content: "";
}
 
 
.tbui-timeline-content::before {
	position: absolute;
	top: 16px;
	right: 100%;
	width: 0;
	height: 0;
	border: 7px solid transparent;
	border-right: 7px solid #CCCCCC;
	content: '';
}
 
.tbui-timeline-content .tbui-timeline-title {
	display: block;
	/*内容标题*/
	margin: 0 0 10px;
	border-left: 6px solid #428bca;
	color: #333333;
	text-indent: 0.4em;
	font-size: 18px;
	line-height: 18px;
}
.tbui-timeline-content .tbui-timeline-date {
	float: left;
	/*日期样式*/
	padding: .8em 0 .4em;
	color: #666666;
}
@media only screen and (min-width: 768px) {
	.tbui-timeline-content {
		margin-left: 0;
		padding: 1em;
		width: 45%;
	}
	.tbui-timeline-content::before {
		top: 8px;
		left: 100%;
		border-color: transparent;
		/*内容框体尖角颜色*/
		border-left-color: #e1e1e8;
	}
	.tbui-timeline-content .tbui-timeline-date {
		/*在宽屏下使日期飞出框架*/
		position: absolute;
		top: 4px;
		left: 122%;
		padding: 0;
		width: 100%;
		font-size: 16px;
	}
	/*宽屏下按奇偶数左右排列*/
	.tbui-timeline-item:nth-child(even) .tbui-timeline-content {
		float: right;
	}
	.tbui-timeline-item:nth-child(even) .tbui-timeline-content::before {
		top: 8px;
		right: 100%;
		left: auto;
		border-color: transparent;
		/*内容框体尖角颜色*/
		border-right-color: #CCCCCC;
	}
	.tbui-timeline-item:nth-child(even) .tbui-timeline-content .tbui-timeline-date {
		right: 122%;
		left: auto;
		text-align: right;
	}
}