简体   繁体   English

如何仅定位段落的第二行

[英]How to target just the second line of a paragraph

I'm looking to make the second line of a continues paragraph to align with where the paragraph first starts.我希望使连续段落的第二行与段落开始的位置对齐。

I have attached an image below of my currently look as well as my code.我在下面附上了我当前外观的图片以及我的代码。

enter image description here在此处输入图像描述

 .headline h1, .headline p { display: inline; vertical-align: top; font-size: 16px; }.headline h1 { font-weight: bold; }.headline { margin-top: 50px; } /* ======================= miss baker qoute settings ======================= */.qoutebaker { margin-left: 85px; color: #c7c7c7; } /* ======================= heading 1 ======================= */ h1, h2{ font-size: 6em; text-transform: uppercase; line-height: 1.6; letter-spacing: 1.4px; margin: 50px 0 0 85px; background: -webkit-linear-gradient(#cfb98b, #a27e4d); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
 <div class="headline"> <h1 class="qoutebaker">Miss Baker:</h1> <p>“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.</p> </div>

use flexbox for this.为此使用 flexbox。 Add margin to p tag if you want to lower the text如果要降低文本,请为 p 标签添加边距

 .headline h1, .headline p { display: inline; vertical-align: top; font-size: 16px; }.headline h1 { font-weight: bold; }.headline { margin-top: 50px; } /* ======================= miss baker qoute settings ======================= */.qoutebaker { margin-left: 85px; color: #c7c7c7; } /* ======================= heading 1 ======================= */ h1, h2{ font-size: 6em; text-transform: uppercase; line-height: 1.6; letter-spacing: 1.4px; margin: 0px 0 0 85px; background: -webkit-linear-gradient(#cfb98b, #a27e4d); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }.headline{ display:flex; align-items:center; margin:0; }
 <div class="headline"> <h1 class="qoutebaker">Miss Baker:</h1> <p>“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.“Do they miss me?” she cried ecstatically.</p> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM