gpt4 book ai didi

jquery - css 适用于除 IE 以外的所有其他浏览器

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

我遇到的问题是我有一个简单的 float 布局,其中一个内容 div 中安装了 s3slider 插件

它在 Internet Explorer 中运行良好,但所有其他浏览器(chrome、ff、opera)的左外边距约为 40px,上外边距约为 15px。我能弄清楚为什么所以我想知道是否有办法添加 left:-40px;顶部:-15px;只能由除 IE 之外的所有浏览器读取。

另一个问题是 slider 的宽度小于其在 IE 中完美匹配的容器的宽度。我还没有找到解决办法。

主要 CSS:

@charset "utf-8";
/* CSS Document */
body{
font-size:12px;
font-family:Verdana, Geneva, sans-serif;
background:#AECF76;
padding:0px;
margin:0px;
}
input[type=submit]{
float:right;
padding:10px;
font-size:14px;
background:#595959;
border:0px;

color:#E4EFD1;
font-weight:bold;
margin-top:10px;
-moz-border-radius:4px;
}

input[disabled=disabled] {
border:0px;
background:0px;
}
input[disabled] {
border:0px;
background:0px;
}
.edit {
border:1px solid red;
background:#FFF;
color:#333;
font-weight:bold;
margin-right:5px;
padding:5px;
}
h1{
font-size:18px;
padding:0px;
margin:0px;
}
h2,h3{
font-size:16px;
padding:0px;
margin:0px;
}
h4,h5,h6{
font-size:14px;
padding:0px;
margin:0px;
}
/* SIZE TABLE */
.cbox{
display:none;
}.sizetable input[type=checkbox] {
display: none;
}
/************/
#container{
width:900px;
margin:0 auto; /**/
/*left: 50%;
top: 50%;
margin-left: auto;
margin-right: auto;*/
}

#header{
width:900px;
float:left;
-moz-border-radius:4px 4px 0 0;
border-radius::4px 4px 0 0;
}
#header img{

-moz-border-radius:4px 4px 0 0;
border-radius:4px 4px 0 0;
}
#content{
width:900px;
float:left;
border:1px solid black;
background:#fff;
}
.leftNavContainer{
width:200px;

float:left;
}
.leftNavHeader{
width:180px;
font-weight:bold;
padding:10px;
font-size:14px;
background:#595959;
color:#E4EFD1;
float:left;
}
.leftNav{
width:200px;
float:left;
height:auto;
}

.leftNav ul{
margin:0px; padding:0px;list-style-type:none;}

.leftNav li a{
background: #E4EFD1;
color: #333;
display: block;
text-decoration:none;
width: 185px;
padding:5px;
padding-left:10px;
}
.leftNav li a:hover{
background: #666;
color: #E4EFD1;


}

.smallblock{
width:680px;
padding:10px;
float:left; position: relative; /*important */
}
/* */
.shadebox{
width:160px;
padding:10px;
float:left;
background:#fff;
}
.shadeboxsml{
width:60px;
padding:10px;
float:left;
background:#fff;
}
.name{
width:155px;
padding-top:10px;
float:left;
text-align:center;
background:#fff;
}
.shadebox .info{
width:160px;
float:left;

}
.shadebox .left{
width:37px;
float:left;

}
.shadebox .front{
width:74px;
float:left;
padding:13px 5px 0px 5px;

}



/* */
.tableHead{
width:835px;
float:left; padding:10px;border:1px solid #AECF76; background:#666; color:#E4EFD1; font-weight:bold;border-bottom:0px;margin-top:10px; display:inline;-moz-border-radius:4px 4px 0 0; font-size:14px;
}
.tableHeadsml{
width:680px;
float:left; padding:10px;background:#E4EFD1;color:#7BA235; margin-top:10px; display:inline;
}
.fullblock{
width:880px;
padding:10px;
float:left;
}
#footer{
width:880px;
padding:10px;
float:left;
background:#E4EFD1;
-moz-border-radius:0 0 4px 4px;
}

slider 的 CSS

 #slider {
width: 680px; /* important to be same as image width */
height: 256px; /* important to be same as image height */
position: relative; /* important */
overflow: hidden; /* important */
float:left;

}

#sliderContent {
width: 680px; /* important to be same as image width or wider */
position: absolute;
top: 0;
margin-left: 0;
float:left;
}
.sliderImage {
float: left;
position: relative;
display: none;

}
.sliderImage img{border:0px;}
.sliderImage span {
position: absolute;
font: 12px/15px Arial, Helvetica, sans-serif;
padding: 10px 10px;
width: 660px;
background-color: #000;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
color: #fff;
display: none;
padding-bottom:14px;
}
.clear {
clear: both;
}
.sliderImage span strong {
font-size: 14px;
}
.top {
top: 0;
left: 0;
}
.bottom {
bottom: 0;
left: 0;
}

ul { list-style-type: none;}

整页代码

<?php 
include"inc/config.php";
include"inc/classes.php";
$page = new Page;
$details = $page->Details('home');

?>
<!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>
<!-- Start JS Plugins-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js"></script>
<script src="plugins/shadesizes.js"></script>
<script type="text/javascript" src="plugins/s3Slider.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#slider').s3Slider({
timeOut: 6000
});
});
</script>
<!-- END Plugins -->
<!-- Start Stylesheets -->


<link href="styles/nmain.css" rel="stylesheet" type="text/css" />
<link href="styles/table.css" rel="stylesheet" type="text/css" />
<link href="styles/tabs.css" rel="stylesheet" type="text/css" />
<style type="text/css" media="screen">
#slider {
width: 680px; /* important to be same as image width */
height: 256px; /* important to be same as image height */
position: relative; /* important */
overflow: hidden; /* important */
float:left;

}

#sliderContent {
width: 680px; /* important to be same as image width or wider */
position: absolute;
top: 0;
margin-left: 0;
float:left;
}
.sliderImage {
float: left;
position: relative;
display: none;

}
.sliderImage img{border:0px;}
.sliderImage span {
position: absolute;
font: 12px/15px Arial, Helvetica, sans-serif;
padding: 10px 10px;
width: 660px;
background-color: #000;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
color: #fff;
display: none;
padding-bottom:14px;
}
.clear {
clear: both;
}
.sliderImage span strong {
font-size: 14px;
}
.top {
top: 0;
left: 0;
}
.bottom {
bottom: 0;
left: 0;
}

ul { list-style-type: none;}
</style>
<!-- END Stylesheets -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Wind Blocker Sun Shades - <?php echo ucwords($details['title']);?></title>
</head>
<body>
<div id="container">

<?php include"inc/header.php";?>
<div id="content">

<!-- START LEFT NAV -->
<?php include"inc/nav.php";?>
<!-- END LEFT NAV -->


<!-- START SLIDE SHOW --> <div class="smallblock">


<div class="smallblock">
<?php echo $details['htmlDesc'];?>
</div>

<div id="footer">
Copyright Lilypad Leisure 2011 - <a href="#">Terms of Sale</a> - <a href="#">Sitemap</a>
</div><!-- END FOOTER -->
</div><!-- END CONTENT -->
</div><!-- END CONTAINER -->



</body>
</html>

最佳答案

将您的 IE 特定样式放在一个单独的 CSS 文件中,然后将该文件包含在您的 HTML 中,如下所示:

<!--[if IE]><link rel="stylesheet" type="text/css" href="ie.css" /><![endif]-->

这些被称为 conditional comments .通过将 if !IE 放入标记中,反过来也可以。

关于jquery - css 适用于除 IE 以外的所有其他浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5059680/

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