[英]How to target just the second line of a paragraph
我希望使連續段落的第二行與段落開始的位置對齊。
我在下面附上了我當前外觀的圖片以及我的代碼。
.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>
為此使用 flexbox。 如果要降低文本,請為 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.