如何样式< blockquote>使用CSS的元素使用:之前:无触摸任何HTML之后
给定HTML引用,我希望CSS在打开和关闭 QUOTES中自动包装“无触摸HTML”。
<blockquote><p>
I love you not only for what you are, but for what I am when I'm with you.
I love you not only for what you have made of yourself, but for what you are making of me.
I love you for ignoring the possibilities of the fool in me, and for accepting the possibilities of the good in me.
I love you for helping me to construct of my life not a tavern, but a temple.
</p></blockquote>
以下CSS起作用,但仅部分是:
blockquote {font-style: italic;}
blockquote:before {content: '“'; float:left;}
blockquote:after {content: '”'; float:right;}
开头报价正确,但关闭引号不是在报价结束后直接放置在点点点所在的位置。同样,报价看起来像是在下一行的垂直误差。
这是一个问题的示例,带有最近电影的引用:
如何以优雅的方式修复它?谢谢!
随意在答案中尝试不同的简单或疯狂的布局,以使其成为社区使用的永恒解决方案。
Given an HTML quote, where I would like CSS to automatically wrap inside opening “
and closing ”
quotes without touchting the HTML.
<blockquote><p>
I love you not only for what you are, but for what I am when I'm with you.
I love you not only for what you have made of yourself, but for what you are making of me.
I love you for ignoring the possibilities of the fool in me, and for accepting the possibilities of the good in me.
I love you for helping me to construct of my life not a tavern, but a temple.
</p></blockquote>
The following CSS works, but only partially:
blockquote {font-style: italic;}
blockquote:before {content: '“'; float:left;}
blockquote:after {content: '”'; float:right;}
The opening quotes are places correctly, but the closing quotes are placed not directly after the end of the quote where the dot is. Also the quote looks like vertically mispositioned at the next line.
Here is an example of the problem, with a quote from a recent movie:
How can this be fixed in an elegant way? Thank you!
Feel free to try different simple or crazy layouts in your answer to make this one a timeless solution for the community to use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
保留引号内联并制作
p
元素内联元素或定位
p
元素Keep the quotes inline and make the
p
element inline as wellOr target the
p
element