Background color not changing in HTML file

时间:2016-12-09 13:07:35

标签: html css colors background

first post here.

I was wondering why the background color is not changing.

I have the bg color property that is not working, apparently.

<body bgcolor="#f0ffff">

This is what I put as the body, and in CSS that's no mention of body whatsoever.

<head>
<title>User Settings</title>
<link rel="stylesheet" type="text/css" href="MainStyles.css">
<!-- Include meta tag to ensure proper rendering and touch zooming -->
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1">

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

<!-- jQueryMobile -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

<script src="JS\changeProfile.js"></script>
</head>

This it the heading of the HTML file, I don't know if this could be what's causing it.

Any help? I'm sorry but I'm quite new to this and it's really frustrating... If you need more info I will post more code.

Just gonna mention that there's no mention of background OR color in the HTML.

2 个答案:

答案 0 :(得分:0)

  1. 在浏览器中打开开发人员工具。
  2. 检查身体元素。
  3. 查看适用于它的样式。
  4. DOM inspector

    http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css正在改变ui-overlay-a类的背景颜色(当加载其JS时,可能是由jQuery Mobile添加到正文中)。

答案 1 :(得分:0)

这不起作用,因为DateTime inDate = Convert.ToDateTime(row.Cells["Day_In"].Value); numDay_In.Text = inDate.Day.ToString(); 包含一个覆盖jquery.mobile-1.4.5.min.css属性的类。

见下文:

Css