CSS圆角在IE8

fzwojiic  于 5个月前  发布在  其他
关注(0)|答案(6)|浏览(46)

我在IE8中遇到圆角问题。我尝试了一些方法都没有成功。
下面是我的代码:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>

<style>
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8em;
  padding: 2px;
  margin: 2px;
  color: #505050;
  line-height: normal;
}
p {
  margin: 4px;
}
.categoryheading3 {
  -moz-border-radius-topleft: 5px;
  -moz-border-radius-topright: 5px;
  -webkit-border-top-left-radius: 5px;
  -webkit-border-top-right-radius: 5px;
  background-color: #297BB6;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 0;
  text-align: center;
  margin: 0px;
}
.leftcolumn {
  width: 174px;
  padding: 8px;
  float: left;
  display: inline-block;
  background-color: transparent;
  /*--min-height: 500px*/
  overflow: hidden;
}
.lefttop {
  display: inline-block;
  width: inherit;
  margin: 0 5px 2em 0;
  float: left;
  width: 160px;
  background-color: #FFFFFF;
  border: 2px solid #297BB6;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}
</style>

</head>
<body>

<div class="leftcolumn">
  <div class="lefttop">
    <H4 class="categoryheading3">Heading</H4>
    <p>sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text </p>
  </div>
</div>
</body>
</html>

字符串
这在Firefox中产生:
x1c 0d1x的数据
在IE8中:



如果任何人有任何提示,我会非常感激!
edit:Joseph建议使用pie.htc,但我仍然在努力解决这个元素不起作用:

.categoryheading3 {
  -moz-border-radius: 5px 5px 0 0;
  -webkit-border-radius: 5px 5px 0 0;
  behavior: url(PIE.htc);
  background-color: #297BB6;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 0;
  text-align: center;
  margin: 0px;
}

vngu2lb8

vngu2lb81#

Internet Explorer(版本9)本身不支持圆角。
有一个神奇的脚本可以神奇地为您添加它:CSS3 PIE
我用过很多次,效果很好。

ztigrdn8

ztigrdn82#

Rounded corners in IE8

Internet Explorer 8(及更早版本)支持圆角,但是您可以考虑一些其他解决方案:

  • 使用圆角Images代替(this生成器是一个很好的资源)
  • here使用jQuery Corner plugin
  • 使用一个非常好的脚本,名为CSS3 PIE,来自**here**(Pro和Con的here
  • here checkout CSS Juice
  • 另一个很好的脚本是来自**here**的IE-CSS3

尽管CSS PIE是最流行的解决方案,但我建议您查看所有其他解决方案,并选择最适合您需求的解决方案。
我希望这是有用的。祝你好运!

w8rqjzmb

w8rqjzmb3#

我不知道css3pie.com,看到这篇文章后,一个非常有用的网站:
但是在测试之后,它对我也不起作用。然而,我发现将它 Package 在.PHP文件中工作得很好。所以,而不是:

behavior: url(PIE.htc);

字符串
使用这个:

behavior: url(PIE.php);


我把我的放在一个名为jquery的文件夹中,所以我的是:

behavior: url(jquery/PIE.php);


所以后藤他们的下载或得到它在这里:
http://css3pie.com/download-latest
并使用他们的PHP文件。在PHP文件中,它解释了一些服务器没有配置为正确的.HTC使用。这就是我遇到的问题。
试试吧!我试过了,它很有效。希望这也能帮助到其他人。

tpgth1q7

tpgth1q74#

http://fetchak.com/ie-css3/适用于IE 6+。如果css3pie不适合您,请使用此选项。

jutyujz0

jutyujz05#

PIE.htc对我来说很好用(http://css3pie.com/),但有一个问题:
你应该写绝对路径到PIE.htc。它没有为我工作时,我使用相对路径。

hiz5n14c

hiz5n14c6#

由于IE浏览器本身不支持圆角,因此更好的跨浏览器处理方法是在边角处使用圆角图像。许多著名网站都使用这种方法。
你也可以在网上找到圆形图像生成器,其中一个链接是http://www.generateit.net/rounded-corner/

相关问题