css - 我想使用行高重叠两行文本 - 最前面的行

标签 css

我需要重叠两行文本,但希望第二行位于第一行下方。这怎么可能使用 css?

http://jsfiddle.net/vkpv9ua0/

   body {
	font-size:30px;
	font-family:"bebas-neue", Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
	background:#50ACFF;
	font-weight:bold;
	
}

.red-text {
	color:#c14345;
	padding-left: 50px;
    text-indent:-50px;
	
}

p.logo::first-line { 
    z-index:99999;

	 color:#FFFFFF;
	
}


p {
	z-index:-9999;
	

}

p.logo {
	line-height:20px;
}
<p class="logo">
<span class="white-text"> CAT | DOG </span><br> <span class="red-text">FISHES</span>
</p>

最佳答案

这是您的开始。这就是你想要的,你只需要搞乱定位。

.red-text {
    color:#c14345;
    padding-left: 50px;
    text-indent:-50px;
    top:-30px;
    position:relative;
}

.white-text { 
    position:relative;
    z-index:99999;

关于css - 我想使用行高重叠两行文本 - 最前面的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26217410/

相关文章:

css - 变换比例时宽度不一致

css - 为比 div 宽的表格启用水平滚动条,而不指定固定宽度

html - 未设置时的相对位置继承

javascript - HTML:未提交文本输入

html - sass 中的冒号,不知道如何在 HTML 中引用

css - 进度条 100% 宽度与 css

javascript - 显示 React 门户时模糊背景

javascript - 为什么 JS 不滚动到顶部?

css - Jekyll CSS 背景图片

html - div在标题周围折叠