html - 无法使用 CSS html 更改网站背景颜色
问题描述
* {
margin:0;
padding:0;
}
html, body {
height:100%;
}
body {
background:#fff;
font-family:Arial, Helvetica, sans-serif;
font-size:100%;
line-height:1.25em;
color:#999;
}
img {
border:0;
vertical-align:top;
text-align:left;
}
object {
vertical-align:top;
outline:none;
}
ul, ol {
list-style:none;
}
.fleft {
float:left;
}
.fright {
float:right;
}
.clear {
clear:both;
}
.col-1, .col-2, .col-3 {
float:left;
}
.alignright {
text-align:right;
}
.aligncenter {
text-align:center;
}
.wrapper {
width:100%;
overflow:hidden;
}
.container {
width:100%;
}
/*==== GLOBAL =====*/
.inner-page {
width:864px;
margin:0 auto;
padding:150px 0 0 0;
font-size:.8125em;
position:relative;
}
.header {
height:149px;
overflow:hidden;
}
.header.small {
height:110px;
}
.content {
padding:0 0 60px 0;
}
.footer {
padding:2px 4px 20px 0;
background:url(images/footer-bg.gif) left top repeat-x;
text-align:right;
}
.page {
height:100%;
width:100%;
min-height:1050px;
height:100% !important;
height:1050px;
position:relative;
}
#services {
background:#181818;
}
#home {
background:#181818;
}
#contacts {
background:#181818;
}
/*----- forms parameters -----*/
input, select, textarea {
font-family:Arial, Helvetica, sans-serif; font-size:1em;
vertical-align:middle;
font-weight:normal;
}
/*----- other -----*/
.img-indent {
margin:0 20px 0 0;
float:left;
}
.img-box {
width:100%;
overflow:hidden;
padding-bottom:20px;
}
.img-box img {
float:left;
margin:0 20px 0 0;
}
.extra-wrap {
overflow:hidden;
}
p {
margin-bottom:20px;
}
.p1 {
margin-bottom:10px;
}
.p2 {
margin-bottom:20px;
}
.p3 {
margin-bottom:30px;
}
/*----- txt, links, lines, titles -----*/
a {
color:#f4f4f4;
outline:none;
}
a:hover{
text-decoration:none;
}
h1 {
font-size:20px;
line-height:1.2em;
color:#f4f4f4;
}
h2 {
font-size:16px;
line-height:1.2em;
color:#f4f4f4;
margin-bottom:11px;
}
h3 {
font-size:40px;
color:#2c3234;
line-height:1.2em;
font-weight:normal;
text-transform:uppercase;
}
h4 {
font-size:1em;
font-weight:normal;
}
.line-ver, .line-ver1 {
background-image:url(images/line-ver.gif);
background-repeat:repeat-y;
width:100%;
}
.link1 {
color:#f4f4f4;
text-decoration:none;
font-size:15px;
padding:0 0 0 10px;
}
.link1:hover {
text-decoration:underline;
}
.address dt {
margin-bottom:16px;
}
.address dd {
clear:both;
color:#fff;
}
.address dd span {
float:left;
width:85px;
color:#999;
}
.address dd a {
color:#999;
}
/*===== header =====*/
.header .logo {
font-size:68px;
line-height:1.2em;
float:left;
}
.header .logo a {
color:#fff;
text-decoration:none;
}
.header .nav {
float:right;
}
.header .nav li {
float:left;
padding-left:5px;
}
.header .nav li a {
float:left;
width:153px;
color:#f4f4f4;
text-decoration:none;
background:url(images/nav-bg.png) no-repeat left top;
font-size:20px;
line-height:46px;
text-align:center;
text-transform:uppercase;
}
.header .nav li a:hover, .header .nav li a.current {
background:url(images/nav-bg.png) no-repeat left -46px;
color:#333;
}
/*===== content =====*/
.content {
}
.list1 li {
font-size:15px;
padding:0 0 4px 0;
}
.list1 li a {
color:#f4f4f4;
text-decoration:none;
background:#f53502;
display:inline-block;
padding:4px 10px 4px 10px;
}
.list1 li a:hover {
background:url(images/bg1.gif) left top;
}
.social-links {
width:100%;
overflow:hidden;
padding:19px 0 0 0;
}
.social-links li {
display:inline;
}
.social-links li a {
float:right;
background:url(images/button-left.gif) no-repeat left top #757575;
color:#fff;
text-align:center;
font-size:20px;
text-decoration:none;
margin-left:3px;
}
.social-links li a span {
float:left;
padding:0 10px 0 10px;
line-height:33px;
background:url(images/button-right.gif) no-repeat right top;
cursor:pointer;
}
.social-links li a:hover {
color:#f53502;
}
.logo-big {
padding-bottom:39px;
}
.description {
color:#2e3436;
font-size:17px;
line-height:24px;
text-transform:uppercase;
text-align:right;
padding-bottom:35px;
}
/*===== footer =====*/
.footer {
font-size:10px;
text-transform:uppercase;
color:#fff;
}
.footer a {
color:#f53502;
text-decoration:none;
}
.footer a:hover {
text-decoration:underline;
}
/*----- forms -----*/
#contacts-form fieldset {
border:none;
width:240px;
}
#contacts-form label {
display:block;
height:40px;
overflow:hidden;
}
#contacts-form input {
width:225px;
padding:6px 5px 6px 8px;
color:#333;
background:#f4f4f4;
border:none;
}
#contacts-form textarea {
width:225px;
padding:6px 5px 6px 8px;
height:100px;
color:#333;
background:#f4f4f4;
border:none;
overflow:auto;
margin-bottom:15px;
}
/*==========================================*/
/*======== home page ============*/
#home .social-links li a {
background:url(images/button-left1.gif) no-repeat left top #d9d9d9;
color:#fff;
}
#home .social-links li a span {
background:url(images/button-right1.gif) no-repeat right top;
}
#home .social-links li a:hover {
color:#f53502;
}
#home .footer {
color:#282f31;
background:url(images/footer-bg1.gif) left top repeat-x;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="description" content="asdfsfsdfsdf" />
<meta name="keywords" content="asdfsfsdfsdf" />
<meta name="robots" content="all" />
<meta name="revisit-after" content="7 days" />
<meta name="author" content="asdfsfsdfsdf" />
<meta name="identifier-url" content="www.asdfsfsdfsdf.com" />
<meta name="distribution" content="Global" />
<meta name="coverage" content="Worldwide" />
<meta name="rating" content="General" />
<meta name="language" content="English" />
<title>asdfsfsdfsdf</title>
<style type="text/css">
div, p, a, li, td { -webkit-text-size-adjust:none; }
@media print {
html, body {
display: none; /* hide whole page */
}
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="http://www.asdfsfsdfsdf.com/style.css" rel="stylesheet" type="text/css" />
<link href="http://www.asdfsfsdfsdf.com/layout.css" rel="stylesheet" type="text/css" />
<script src="http://www.asdfsfsdfsdf.com/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="http://www.asdfsfsdfsdf.com/js/cufon-yui.js" type="text/javascript"></script>
<script src="http://www.asdfsfsdfsdf.com/js/cufon-replace.js" type="text/javascript"></script>
<!--[if lt IE 7]>
<link href="http://www.asdfsfsdfsdf.com/ie_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://www.asdfsfsdfsdf.com/js/ie_png.js"></script>
<script type="text/javascript">
ie_png.fix('.png, .nav a');
</script>
<![endif]-->
<script language="JavaScript">
/**
* Disable right-click of mouse, F12 key, and save key combinations on page
* By Arthur Gareginyan (arthurgareginyan@gmail.com)
* For full source code, visit https://mycyberuniverse.com
*/
window.onload = function() {
document.addEventListener("contextmenu", function(e){
e.preventDefault();
}, false);
document.addEventListener("keydown", function(e) {
//document.onkeydown = function(e) {
// "I" key
if (e.ctrlKey && e.shiftKey && e.keyCode == 73) {
disabledEvent(e);
}
// "J" key
if (e.ctrlKey && e.shiftKey && e.keyCode == 74) {
disabledEvent(e);
}
// "S" key + macOS
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
disabledEvent(e);
}
// "U" key
if (e.ctrlKey && e.keyCode == 85) {
disabledEvent(e);
}
// "F12" key
if (event.keyCode == 123) {
disabledEvent(e);
}
}, false);
function disabledEvent(e){
if (e.stopPropagation){
e.stopPropagation();
} else if (window.event){
window.event.cancelBubble = true;
}
e.preventDefault();
return false;
}
};
</script>
</head>
<body bgcolor="#333" oncopy="return false" oncut="return false" onpaste="return false">
<!-- privacy page begin -->
<div id="services" class="page">
<div class="inner-page">
<!-- header begin -->
<div class="header">
<div class="logo"><a href="http://www.asdfsfsdfsdf.com/index.html"><img alt="asdfsfsdfsdf" src="http://www.asdfsfsdfsdf.com/images/asdfsfsdfsdf.jpg" /></a></div>
<ul class="nav">
<li><a href="http://www.asdfsfsdfsdf.com/index.html" class="q1">home</a></li>
</ul>
</div>
<!-- header end -->
<!-- content end -->
<div class="content">
<h2>asdfsfsdfsdf™</h2>
<br/>*asdfsfsdfsdf
<br/>*asdfsfsdfsdf
<br/>*asdfsfsdfsdf
<br/>*asdfsfsdfsdf
</p>
<br>
asdfsfsdfsdf
<br><br><br><a href="http://www.asdfsfsdfsdf.com/asdfsfsdfsdf.html">Request</a> a complimentary sample pack.
<br><br><br><br>
</div>
<!-- content end -->
<!-- footer begin -->
<div class="footer">
Copyright © 2013-2018 asdfsfsdfsdf, LLC. All Rights Reserved <a href="http://www.m.asdfsfsdfsdf.com/index.html">view mobile</a>
</div>
<!-- footer end -->
</div>
</div>
<!-- privacy page end -->
<!-- coded by ramzes -->
<script type="text/javascript"> Cufon.now(); </script>
</body>
</html>
新手来了 我尝试在几个不同的点更改背景颜色,但没有运气。在不同的页面上,它可以工作!我尝试比较和对比不同的代码以找出差异 - 还尝试更改外部 CSS 文件和 bgcolor 中的值。删除临时互联网文件,关闭浏览器并重新启动。我还验证了我更新了我需要的文件,保存了它们,然后尝试在浏览器中再次打开文件(进行测试)。我确认我打开了正确的文件。任何帮助都非常感谢。谢谢。
这里是改变应该生效的地方:
#services {
background:#181818;
}
这是我的一些 HTML 代码:
</head>
<body bgcolor="#333" oncopy="return false" oncut="return false" onpaste="return false">
<!-- privacy page begin -->
<div id="services" class="page">
<div class="inner-page">
<!-- header begin -->
<div class="header">
<div class="logo"><a href="http://www.example.com/index.html"><img alt="fasdfsdfdfasdf" src="http://www.example.com/images/asdfasdfdsaf.jpg" /></a></div>
<ul class="nav">
<li><a href="http://www.example.com/index.html" class="q1">home</a></li>
</ul>
</div>
<!-- header end -->
<!-- content end -->
<div class="content">
<h2>asdfasdf™</h2>
解决方案
推荐阅读
- java - Selenium java 3.141.59 - WebDriver 和 FirefoxDriver 问题
- python-3.x - 如何使用 Python 和 WC-API 从 WooCommerce 软件插件中获取 api 信息
- python - 用networkx计算最短路径
- r - 如何修复 cpcbp 中文件(con,“r”)中的错误
- sql - 在 SQL 中插入重复值
- wordpress - 在 Smart Slider Carousel 上使活动幻灯片稍大
- php - 使用 Angular6-Yii2 上传图片和文字
- python - 在numpy中查找第一个非零行
- java - API alfresco repository 6.X 或 7.X 版本的应用上下文初始化问题
- java - 当我更改边框布局时,JPanels 不会四处移动