gpt4 book ai didi

html - CSS : Two image on one html element in IE

转载 作者:太空宇宙 更新时间:2023-11-03 20:22:47 25 4
gpt4 key购买 nike

HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>
Hello
</title>
<style type="text/css">

div#myDiv {
border: 1px solid #bed6f8;
background: url(images/image1.gif) no-repeat 5px bottom, #bed6f8 url(images/image2.png) repeat-x;
color: #000000;
font-weight: bold;
}

</style>
</head>
<body>
<div id="myDiv">
<br>
<br>
<br>
</div>
</body>
</html>

火狐:

enter image description here

即:

enter image description here

菜单相关代码

<div id="menu">
<ul class="menu">
<li><a class="leftCornerRound parent menuheader" id="home" href="#"><span>Item 1</span></a>
<div>
<ul>
<li><a class="parent" href="#" id="SubItem1"><span>Sub Item 1</span></a>
<div><ul>
<li><a class="parent" href="#" id="SubItem1.1"><span>Sub Item 1.1</span></a>
<div><ul>
<li><a class="ui-widget-header" href="#"><span>Sub Item 1.1.1</span></a></li>
<li><a class="ui-widget-header" href="#"><span>Sub Item 1.1.2</span></a></li>
</ul></div>
</li>
.
.
.
.

与此相关的CSS:

div#menu a.parent {
border: 1px solid #bed6f8;
background: url(images/submenu-pointer-bottom.gif) no-repeat 5px bottom, #bed6f8 url(css/blueSky/images/header.png) repeat-x;
color: #000000;
font-weight: bold;
}

div#menu a.parent:hover {
border: 1px solid #bed6f8;
background: url(images/submenu-pointer-bottom.gif) no-repeat 5px bottom, #c6deff url(css/blueSky/images/default.png) repeat-x;
font-weight: bold;
color: #000000;
}

最佳答案

我建议添加另一个包装元素,并为其应用第二个背景。

您已经有了一个包装器元素。你有 lia

你应该把css/blueSky/images/default.png背景放在li上,留下images/submenu-pointer-bottom.gif a 上的背景。

确保元素的位置正确:li 需要 float: lefta 需要 display : block


如果您需要在低于 v9 的 IE 中的单个元素上使用多个背景,您可以使用 CSS3 PIE :
http://css3pie.com/documentation/supported-css3-features/#pie-background

关于html - CSS : Two image on one html element in IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6425328/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com