【问题标题】:CSS on Blogger.com behaves/aligns differently when viewed in Chromium and Firefox/Opera在 Chromium 和 Firefox/Opera 中查看时,Blogger.com 上的 CSS 行为/对齐方式不同
【发布时间】: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


    【解决方案1】:

    首先清理您的浏览器缓存并更新浏览器我检查您的链接它在浏览器 chrome 和 firefox 中都运行良好。以及为什么你一遍又一遍地使用这些 br 标签只是应用 margin-top 和你的好去

    【讨论】:

    • 谢谢你,Akshay。我按照你的建议做了,但结果是一样的。我从另一台计算机检查,问题仍然存在。以下是屏幕截图:Chromium CSS behaviourFirefox CSS behaviour。还要感谢margin-top 提示,我将很快重新编写代码,也许这会有所帮助。我会在这里评论结果。
    • 它的跨浏览器问题,因为我无法测试您的代码,我无能为力
    • 感谢您的宝贵时间。我用 margin-top 更新了代码。现在情况好一些了,但还是不一样。我在另一个答案中找到了原因,我将其添加到我的问题中。 Firefox 将字体渲染得更大一些。
    猜你喜欢
    • 2013-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-12
    • 2014-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多