【发布时间】:2017-01-19 11:06:03
【问题描述】:
我在我的博客网站上使用自定义 CSS。当 CSS 只涉及一篇文章时,我在文章本身中使用 CSS 代码。例如,我用它来将一首诗的行与图形背景对齐。由于我使用 Chromium(在 Linux Mint 18.1 中),因此我使用此浏览器来检查结果。但是,当我在 Firefox 中查看同一篇已发布的帖子时,CSS 对齐已关闭。
编辑:也检查了 Opera,其行为与 Firefox 相同(即 Firefox 和 Opera 以相同的方式呈现文本,但与 Chrome/Chromium 不同)。
安装了两个(或更多)浏览器的任何人都可以在这两个浏览器中使用check out the post。
整个邮编如下:
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: center;" trbidi="on">
<div class="image">
<br /></div>
<div class="image">
<a href="http://tsairi.deviantart.com/art/The-Birds-437529362" target="_blank"><img alt="the birds by tsairi final day poem by mozzribo" height="1808" src="https://i.imgur.com/hC2zfVe.png" title="The Birds by Tsairi − click for image source" width="434" /></a>
<br />
<div class="text">
<span style="color: white;">
A seraph approached me last night<br />
Gave me a burning letter and flew away blazing<br />
As I broke the wax stamp a black phoenix fluttered before me<br />
It took me to the fractal spiral and shattered my body<br />
And with it all of my self-proclaimed sins<br />
The eternity that is to be was one and I was told that<br />
There is nothing to regret and there will never be<br />
If I should go through this scabrous wildwood again<br />
I would, just to live again that night when we met at the cemetery<br />
The bird sent me back to believe that there is nothing to regret<br />
Aye, there is nothing to regret<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
When the time comes for gentlemen Their ethics to deprave<br />
I’ll be standing in front of my children’s grave<br />
I’ll be asking with a brain gone illogically brave<br />
Where is my promised final day<br />
That has been taken from the grievous away<br />
Who will kindly grant it to me<br />
Where are the pages of Genesis Lost<br />
And who will pay the cost<br />
Where is my promised final day<br />
That has been taken from the grievous away<br />
Who will kindly grant it to me<br />
Where are the pages of Genesis Lost<br />
And who will pay the cost<br />
Better than my noose in the company of I to be tossed<br />
I to be tossed<br />
Who will kindly stand in front of me and say<br />
"There is still a cigarette to finish in the ashtray."<br />
</span>
</div>
</div>
</div>
<style>
.image {
position:relative;
float:center; /* optional */
}
.image .text {
position:absolute;
color: black;
text-shadow: 0px 0px 5px rgba(0, 0, 0, 1);
font-size: 11pt;
top:10px; /* in conjunction with left property, decides the text position */
margin-top:650px;
left:39px;
width:783px; /* optional, though better have one */
}
</style><br /></div>
我在以下答案中发现了似乎导致问题的原因: https://webmasters.stackexchange.com/questions/14324/font-displays-differently-in-firefox-vs-chrome/14347#14347
但我不知道这是否可以解决。有没有办法强制浏览器像其他浏览器一样呈现文本?
关于如何使 CSS 在所有浏览器中的行为都相同的任何建议?
【问题讨论】:
标签: html css firefox blogger chromium