主题在第一次加载时无法正确显示图像

时间:2012-05-30 18:01:20

标签: html css tumblr

问题仍然没有解决,我不知道为什么。然而;改变另一个主题可以解决它 。 .......................................

我对tumblr的主题有疑问。它从第一次开始就没有“起作用”。这并不意味着它不起作用。 仅在刷新页面后才有效。

我第一次加载页面;内容的大多数元素(图像)都是非样式的;他们互相重叠,这很烦人

这是主题

http://tinypaste.com/fa31b3

如果我没错;这是对图像的负责。

 .entry img { 
{block:IndexPage}
width: {block:IfNot2Columns}240px{/block:IfNot2Columns}{block:If2Columns}500px{/block:If2Columns}; 
{/block:IndexPage}
{block:PermalinkPage}
width:500px;
{/block:PermalinkPage}
}  
你能帮助我吗?任何想法将不胜感激

2 个答案:

答案 0 :(得分:1)

原因是浏览器使用以前的图像样式来缓存样式,因此浏览器没有为图像设置实际规则(只有前置样式)。

我为您提供了更具可读性和灵活性的解决方案,无需例外:

Tumblr标记:

<body class="
{block:IndexPage}
    index-page
    {block:IfNot2Columns}not-twocolumns{/block:IfNot2Columns}
    {block:If2Columns}twocolumns{/block:If2Columns}
{/block:IndexPage}
{block:PermalinkPage} permalink-page{/block:PermalinkPage}
">

<强> CSS:

.index-page.not-twocolumns .entry img {
    width: 240px;
}

.index-page.twocolumns .entry img {
    width: 500px;
}

.permalink-page .entry img {
    width: 500px;
}

答案 1 :(得分:0)

你有足够的时间来加载页面上的内容吗?

当我在我过时的笔记本电脑上使用facebook时,同样的事情发生在我身上,但是一旦所有内容都加载,它会在大约30-40秒内自行修复。