【问题标题】:Couldn't change background color with css [duplicate]无法使用 css 更改背景颜色 [重复]
【发布时间】:2018-08-05 05:25:10
【问题描述】:

我想更改我的登录页面背景颜色,但是当我尝试更改此代码时没有任何变化

body{
    background:#f1f9f9;
}

它总是向我展示海军颜色。它有什么问题?我试图更改完整 style.css 文件中的所有代码颜色,但所有颜色包含仍然没有更改。 这是 style.css

@charset "utf-8";
/* CSS Document */

body{
    background:#f1f9f9;
}

.form-signin {
    max-width: 500px;
    margin: 0 auto;
}
.form-signin h2, .office h2 {
  color: #fff;
  margin-top:18px;
  margin-bottom:45px;
  line-height: 10px;
  font-size: 60px;
  text-shadow: 0 1px 0 #ccc,0 2px 0 #c9c9c9,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,.1),0 0 5px rgba(0,0,0,.1),0 1px 3px rgba(0,0,0,.3),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.15)
}

.form-signin .form-signin-heading{
    color:#00A2D1;
}
.form-signin input[type="text"],
.form-signin input[type="password"],
    font-size: 16px;
    height: 45px;
    background-color: #f1f9f9;
    padding: 7px 9px;
}

.signin-form
{
  margin-top:110px;
}
.body-container
{
    margin-top:70px;
}
body.special-page{
  background: url("../img/special-page-bg.png") no-repeat scroll top center #2b3237;  
}
.navbar-brand{
    font-family:"Lucida Handwriting";
}
#btn-submit{
    height:45px;
}
/* Sticky footer styles
-------------------------------------------------- */
.footer {
  padding: 40px 0;
  color: #999;
  text-align: center;
  border-top: 1px solid #e5e5e5;
}
.footer p:last-child {
  margin-bottom: 0;
}

这是关于css的登录页面代码(index.php)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Portal Bimbingan TA Polmed</title>

    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/font-awesome.css" rel="stylesheet">  
    <link href="assets/css/style.css" rel="stylesheet" type="text/css">
    <link rel="shoutcut icon" href="logo.png">
</head>
<body class="special-page"> 
    <div class="signin-form">
        <div class="container">
        ..............  

非常希望得到您的帮助。我不喜欢看到深蓝色,因为我的大学默认颜色是紫色(我制作了一个大学网站)。我很奇怪看到它。提前致谢

【问题讨论】:

  • 您能否在 Chrome 中右键单击您的页面,单击检查并截取开发工具的完整屏幕截图并与我们分享,好吗?确保您已选择左侧的&lt;body 标签。或者有没有办法让我们在网上看一下?有链接之类的吗?
  • 使用 !important 关键字
  • @Praveen Kumar Purushothaman 这是siteofmeylina.web.id 你能帮帮我吗?哪里可以改?谢谢之前

标签: css


【解决方案1】:

您确实更改了正文背景颜色,但您的背景上有这个类并且您设置了它的样式:

body.special-page{
    background: url("../img/special-page-bg.png") no-repeat scroll top center #2b3237;  
}

试试这个:

body.special-page{
    background: f1f9f9;  
}

【讨论】:

  • 感谢您的回复。我会试试看。非常感谢。
猜你喜欢
  • 2017-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-15
  • 1970-01-01
  • 2012-05-05
  • 2018-03-22
相关资源
最近更新 更多