php - 损坏的 CSS Sprite

标签 php html css

全部。我的 CSS Sprite 出现了一些奇怪的故障,显示在以下代码中:

<footer>
    <div id="social">
        <a href="#" target="_blank" class="socialicons twitter">Twitter</a>
        <a href="#" target="_blank" class="socialicons linkedin">Linked In</a>
        <a href="#" target="_blank" class="socialicons facebook">Facebook</a>
        <a href="#" target="_blank" class="socialicons google">Google</a>
        <a href="#" target="_blank" class="socialicons flickr">Flickr</a>
        <span class="email">dan&#64;fifthgospelministries.com</span>
        <span class="phone">717-395-1234</span>
    </div>
</footer>

当文件保存为 html 文件时它工作正常,但是当我将它转换为 php 文件时图像中断。

这可以在 idealbrandon.com/new/index.php(损坏)和 idealbrandon.com/new/index.html(工作)上查看。

编辑 我忘记包含 css。 相关的 CSS 在这里:

footer{
    background: #323232;
    padding: 3em;
}

#social{
    width:60%;
    margin: 0 auto;
    text-align:center;
    width:250px;
    height:135px;
    padding-bottom:1em;
}

#social a{
    display:block;
}

.socialicons {
    height: 50px;
    width: 50px;
    padding: 0;
    margin: 0;
    text-indent: -9999px;
    float:left;
}

.twitter{  background: url('img/social.png') 0 0; }
.linkedin{ background: url('img/social.png') 200 0; }
.facebook{ background: url('img/social.png') 150 0; }
.google{   background: url('img/social.png') 100 0; }
.flickr{    background: url('img/social.png') 50 0; }

.twitter:hover{   background: url('img/social.png') 0 50; }
.linkedin:hover{  background: url('img/social.png') 200 50; }
.facebook:hover{  background: url('img/social.png') 150 50; }
.google:hover{    background: url('img/social.png') 100 50; }
.flickr:hover{     background: url('img/social.png') 50 50; }

.email{
    background-color:#8b8b8b;
}

.phone{
    background-color:#a6a6a6;
}

.email, .phone{
    font-weight: 400;
    color:#fff;
    display: block;
    float: left;
    width: 250px;
    height: 50px;
    text-align: center;
    line-height: 3.2;
}

.email:hover, .phone:hover{
    color:#fff;
    background-color:#9c1e20;
}

有什么想法吗?

最佳答案

在您的 CSS 中(style.css 第 306 行):

.linkedin{ background: url('img/social.png') 200 0; }

应该是:

.linkedin{ background: url('img/social.png') 200px 0; }

当非零时,CSS 中通常需要单位。

关于php - 损坏的 CSS Sprite ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19374381/

相关文章:

css - 如何定位 CSS 表单标签/值?

php - 对多个单独的 PHP 数组进行排序并保持键同步

javascript - 在 Laravel 中使用 Ajax 保存路径图像

PHP 重定向而不修改 header

javascript - 如何在我的文件输入字段中允许所有 excel 格式

css - 具有来自 View 的动态 Assets url 背景图像的 Rails

php - 通过 PHP 运行时 Node 不起作用

Java MySQLSyntaxErrorException?为什么我的 SELECT 语句不正确?

html - 后代选择器和直接后代选择器之间的最佳实践/性能

HTML+CSS Footer - 格式化菜单下方的文本