C# MVC3中的CSS背景图像-续
我最近购买了一个引导主题,我正试图将其应用到我的MVC3 Web应用程序项目中 在social-icons.css中获取背景图像以进行渲染时遇到问题 在_Layout.cshtml中,我引用了:C# MVC3中的CSS背景图像-续,c#,css,asp.net-mvc,asp.net-mvc-3,razor,C#,Css,Asp.net Mvc,Asp.net Mvc 3,Razor,我最近购买了一个引导主题,我正试图将其应用到我的MVC3 Web应用程序项目中 在social-icons.css中获取背景图像以进行渲染时遇到问题 在_Layout.cshtml中,我引用了: link href="@Url.Content("~/Content/social-icons.css")" rel="stylesheet" type="text/css" 在标题中 在social-icons.css中: [class^="social-"], [clas
link href="@Url.Content("~/Content/social-icons.css")" rel="stylesheet" type="text/css"
在标题中
在social-icons.css中:
[class^="social-"],
[class*="social-"] {
display: inline-block;
width: 40px;
height: 40px;
margin-right: .3em;
line-height: 40px;
vertical-align: text-top;
background-image: url("img/icons/social-icon-set.png");
background-position: 40px 40px;
background-repeat: no-repeat;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-webkit-border-radius: 50em;
-moz-border-radius: 50em;
border-radius: 50em;
}
我已经检查了social-icons.css的两个路径
和social-icons-set.png,所有内容都显示在屏幕上
我检查了这里的问答,这对我没有帮助
希望对任何不清楚的信息提前道歉。CSS文件中的任何路径始终与CSS文件本身相关。 png是否位于
Content/img/icons/social icon set.png
因为CSS文件和您的信息表明它应该在那里。您的图像位置错误 以下是您所拥有的:
background-image: url("img/icons/social-icon-set.png");
我们可以看到您的屏幕截图,它是社交图标集(注意额外的“s”):
您好Farrowdm,欢迎来到StackOverflow。我觉得你的问题很好,很清楚,所以我希望我们能帮上忙。显然不是。(见Mattytomo的回答)哈哈,我的胃不舒服。非常感谢。@farrowdm Hehe没问题,这些事情发生在我们所有人身上!欢迎来到SO:)