小编mid*_*ack的帖子

透明背景问题IE8,IE7

为我的菜单使用图标(.png透明背景).IE9,Chrome,Firefox,safari,opera没有任何问题.但是如果我用IE7或IE8打开页面,图像周围会出现黑色边框.CSS代码;

.menu-item1{
  background:url(img/spriteimage.png) no-repeat 0 0;
  height:20px;
  width:20px;
  opacity:0.5;
 } 
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

css png background-image internet-explorer-8 internet-explorer-7

3
推荐指数
1
解决办法
1万
查看次数

动态高度div根据调整大小窗口

HTML

<div class="header">Header</div>
 <div class="body">
    <table class="body-table">
        <tr>
            <td>Cell</td>
            <td>Cell</td>
            <td>Cell</td>
        </tr>
        <tr>
            <td>Cell</td>
            <td>Cell</td>
           <td>Cell</td>
       </tr>
       <tr>
           <td>Cell</td>
           <td>Cell</td>
           <td>Cell</td>
       </tr>
       <tr>
           <td>Cell</td>
           <td>Cell</td>
           <td>Cell</td>
        </tr>
        <tr>
           <td>Cell</td>
           <td>Cell</td>
           <td>Cell</td>
        </tr>
        <tr>
           <td>Cell</td>
           <td>Cell</td>
           <td>Cell</td>
        </tr>
        <tr>
           <td>Cell</td>
           <td>Cell</td>
           <td>Cell</td>
        </tr>
    </table>    
 </div>
<div class="footer">
    <button>Submit</button>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.header{
    height:50px;
    background-color:#ccc;
    width:500px;
}
.body{
    width:500px;
    max-height:600px;
    text-align:center;
    background-color:#ddd;
    overflow:auto;
}
.body .body-table{
    border-collapse:collapse;
    text-align:center;
    margin:0 auto;
    width:100%;
 }
.footer{
    width:500px;
    height:50px;
    background-color:#eee;
}
Run Code Online (Sandbox Code Playgroud)

JQUERY

var windowHeight = $(window).height();
$(window).resize(function(){ …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery height

3
推荐指数
1
解决办法
6042
查看次数

溢出:隐藏问题Internet Explorer 7

HTML

<div class="block">
    <div class="element1">text text text text </div>
    <div class="element2">text text text text text text text text text text text text text text text text text text text text text text text text text text text text</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.block{
    background:#F00;
    float: left;
    height: 90px;
    padding: 0 24px 0 0;
    position: relative;
    width: 256px;
}   
.block .element1{
    color: #000;
    display: block; 
    float: left;
    font-size: 32px;
    height: 35px;
    overflow: hidden;
    padding: 25px 0 0;
    text-align: right;
    width: 100%;
}
.block …
Run Code Online (Sandbox Code Playgroud)

html css internet-explorer overflow internet-explorer-7

1
推荐指数
1
解决办法
1万
查看次数

如何将类添加到特定的日期选择器?

HTML

<input type="text" class="datepicker01">
<input type="text" class="datepicker02">
Run Code Online (Sandbox Code Playgroud)

我有 2 个打开日期选择器的输入。我想将类添加到在第二个输入中打开的日期选择器 (class="datepicker2")。我怎样才能做到这一点?

http://jsbin.com/cixubuto/1/edit

jquery addclass jquery-ui jquery-ui-datepicker

1
推荐指数
1
解决办法
3213
查看次数

如何检测以 javascript 结束的窗口滚动?

我想在滚动结束后向选定元素添加一个类。JS如何检测滚动结束?

超文本标记语言

<ul class="list" id="wrapper">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
    <li id="element">7</li>
    <li>8</li>
    <li>9</li>
    <li>10</li>
 </ul>
Run Code Online (Sandbox Code Playgroud)

JS

const element = document.getElementById('element');
const y = element.getBoundingClientRect().top + window.scrollY;


window.scroll({
  top: y,
  behavior: 'smooth'
});
Run Code Online (Sandbox Code Playgroud)

JSBIN 示例

html javascript scroll

1
推荐指数
1
解决办法
5557
查看次数

如何使用jQuery从表中的最后一个tr中选择前一个td?

我想从表中的最后一个tr中选择并更改之前的tds,但我不能.我怎么能用jQuery做到这一点?

在此输入图像描述

选择prev tr with;

$(".tbl tr:last-child").prev()
Run Code Online (Sandbox Code Playgroud)

但我如何选择prev tr的孩子呢?

http://jsfiddle.net/dba7v/1/

javascript css jquery html-table

0
推荐指数
1
解决办法
1084
查看次数

我可以检查父元素在sass中是否有特定的类?

如果父元素具有特定的类,我想有条件地赋值.经验:

HTML

<div class="parent">
    <div class="child">Some Text</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.child {
    font-size: 16px;
}
Run Code Online (Sandbox Code Playgroud)

但如果父元素有一个名为"大"的类

HTML

<div class="parent big">
    <div class="child">Some Text</div>
</div>
Run Code Online (Sandbox Code Playgroud)

我想改变价值如下

CSS

.child {
    font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)

例如如下:

.child {
  font-size: parent.hasClass('big') ? 20px : 16px;
}
Run Code Online (Sandbox Code Playgroud)

我怎样才能在SASS中做到这一点?

css conditional if-statement sass ternary-operator

0
推荐指数
1
解决办法
5462
查看次数

如何将使用ngfor打印的数据以角度分割为3列?

数据

const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30];
Run Code Online (Sandbox Code Playgroud)

我想将这些数据拆分为3列,并希望如下所示:

<ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    ...
    <li>10</li>
</ul>
<ul>
    <li>11</li>
    <li>12</li>
    <li>13</li>
    ...
    <li>20</li>
</ul>
<ul>
    <li>21</li>
    <li>22</li>
    <li>23</li>
    ...
    <li>30</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

使用ngfor时如何拆分数据?

<ul *ngFor="let item of arr">
    <li>{{item}}</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

javascript split html-lists ngfor angular

0
推荐指数
1
解决办法
541
查看次数