分类 "Web" 下的文章

问题:如何使用html,css实现问号提示信息?不使用js

解决:使用hint.css或自己写

方法:

方法一:

使用hint.css
http://kushagragour.in/lab/hint/

方法二:

<div id="content">
    <div class="help-tip">
        <p>This is the inline help tip! You can explain to your users what this section of your web app is about.</p>
    </div>
    <p>此代码共3种演示效果,请点击上面的按钮进行切换。</p>
    <p>鼠标移到右侧的“?”问号上查看效果。</p>
</div>

阅读全文

问题:如何去除input,textarea focus时的边框
解决:使用outline
方法:
css样式 outline:none;

问题:在chrome浏览器中,图片加载失败,如果有alt属性会出现一个小图标和边框,如何去除?
解决:使用css样式去除
方法;
img{
display:block;
margin:0 auto;
min-width:160px;
max-width:194px;
height:240px;
line-height:240px;
border:none;
position:relative;
overflow:hidden;
}
img:after {
content:attr(alt);
font-size: 16px;
display: block;
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #efefef;
}

参考:https://bitsofco.de/styling-broken-images/?utm_source=CSS-Weekly&utm_campaign=Issue-206&utm_medium=web

问题:如何使用css来设置table的cellspacing和cellpadding呢?
解决:使用border-collapse, border-spacing, padding
方法:
table{
border-collapse:collapse;
border-spacing:0;
}
table tr td{
padding:0;
}