在我刚刚为我的网站创建的设计中,我使用 css 中的 span 技术使用两个引用图像设置了 block 引用样式:
blockquote {
background-image: url(images/openquote.jpg);
background-repeat: no-repeat;
background-position: left 5px;
padding-left: 30px;
padding-right: 30px;
font-style: italic;
}
blockquote span {
background-image: url(images/closequote.jpg);
background-repeat: no-repeat;
background-position: right bottom;
display: block;
padding-right: 30px;
font-style: italic;
}
然后我像这样格式化 HTML:
<blockquote><span>
"The worst part of writing fiction is the fear of wasting your life behind a keyboard. The idea that, dying, you'll realize that you only ever lived on paper. Your only adventures were make-believe, and while the world fought and kissed, you sat in some dark room, masturbating and making money."<br /><br /><b><div align="right">- Chuck Palahniuk</div></b>
</span></blockquote>
在我创建的测试 HTML 页面上,引述工作正常并且完全符合我的要求。现在,我正在将我的所有编码转移到 Wordpress,但是, block 引用不会以相同的方式显示。
HTML:lifesgarbage.com/rebnation.html(抱歉,我还不能发布多个链接)
WordPress: http://test.lifesgarbage.com
如何更改我的 CSS,使其在 Wordpress 上的显示方式与在常规 HTML 上的显示方式类似?
最佳答案
我认为答案是 wordpress 将 blockquote 标记的默认边距定义为 0。你应该在你的 css 中添加一个明确的边距值。
关于css - 为什么我不能在 Wordpress 中正确设置 block 引用的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1730686/