背景为灰色,字体颜色为红色,运行后发现在IE8下文字周围有黑色边线,很难看,可是在其他浏览器下没有问题。而且我将网页保存为html后重新用IE8打开,文字周围就没有边框了。
请问这是怎么回事啊?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="p1.test" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align:center;background-color:Gray;">
<div style="FILTER:alpha(opacity=100);">
<div style="float:right;margin-right:40px;font-size: 26px;color:Red">
文字怎么有黑色边框
</div>
</div>
</div>
</form>
</body>
</html>
请问这是怎么回事啊?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="p1.test" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align:center;background-color:Gray;">
<div style="FILTER:alpha(opacity=100);">
<div style="float:right;margin-right:40px;font-size: 26px;color:Red">
文字怎么有黑色边框
</div>
</div>
</div>
</form>
</body>
</html>
background-color:Gray;把这去掉就OK了,maybe是有的浏览器不支持此属性。
加入在head 中:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
试一试...