简体   繁体   English

html 中的语义分割报价

[英]Semantically splitted quote in html

What is the best practice to make block quote but the text is not all in one line here is an image to clarify what i mean进行块引用的最佳做法是什么,但文本并非全部在一行中,这是一张图片来澄清我的意思

在此处输入图像描述

how to achieve this layout?如何实现这种布局? and is it also possible if i use h1 for the text inside the block quote since this is the main header of the website?如果我使用 h1 作为块引用内的文本,是否也可以,因为这是网站的主要 header?

here is what i did这就是我所做的

 div { font-size: 5vw; } img { position: relative; top: -2vw; z-index: -1; }.bottom { position: relative; top: -5.5vw; }
 <blockquote> <div class="top"> the quick <br> brown fox </div> <img src="https://images.unsplash.com/photo-1560809451-9e77c2e8214a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt=""> <div class="bottom"> jumps over <br> the lazy dog. </div> </blockquote>

The HTML <blockquote> Element (or HTML Block Quotation Element) indicates that the enclosed text is an extended quotation. HTML <blockquote>元素(或 HTML 块引用元素)指示所附文本是扩展引用。

I'm not sure why you want to use a blockquote if this is the main header of the website .如果this is the main header of the website blockquote不确定为什么要使用块引用。

 header { font-size: 2rem; line-height: 0.8; max-width: 200px; } header * { display: block; } header.top, header.bottom { position: relative; } header.top { top: 0.5em; } header.bottom { bottom: 0.5em; }.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
 <header class="page-header"> <h1 class="sr-only">The quick brown fox jumps over the lazy dog.</h1> <span class="top" aria-hidden="true">The quick brown fox</span> <img src="https://images.unsplash.com/photo-1560809451-9e77c2e8214a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=200&q=60" alt="Cool but very serious fox getting ready to jump"> <span class="bottom" aria-hidden="true">Jumps over the lazy dog.</span> </header> <main> <p>Other content</p> </main>

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

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