CSS拾遗(二)
接CSS拾遗(一)。
4. 不透明度
opacity: 0.8;
filter: alpha(opacity=80);
opacity: 0.8是标准的写法;filter: alpha(opacity=80)是IE6-9的写法,IE9之前不支持opacity。
5. 链接样式顺序
a:link, a:visited, a:hover, a:focus, a:active
记忆口诀:love-hate,其中focus最好加上,表示用键盘移动到链接上时,与鼠标悬停一样的概念。
6. line-height
这个还是看《CSS权威指南》吧,相关的东西挺多的。
7. 纯CSS提示工具
通过定位技术,可以创建纯CSS工具提示。
a.tooltip {
position: relative;
}
a.tooltip span {
display: none;
}
a.tooltip:hover span {
display:block;
position:absolute;
top:1em;
left:2em;
width: 8.5em;
padding: 0.2em 0.6em;
border:1px solid #996633;
background-color:#FFFF66;
color:#000;
}
</style>
</head>
<body>
<p><a href="http://www.andybudd.com/" class="tooltip">Andy Budd<span> (This website rocks) </span></a> is a web developer based in Brighton England.</p>
</body>

8. 流式布局min-width、max-width理解
使用流式布局时,尺寸是用百分数一类设置的,这使流式布局能够相对于浏览器窗口进行伸缩。流式布局也不是没有问题,
在窗口宽度很小的时候,行变得非常窄,难以阅读。因此,有必要添加以像素或em为单位的min-width,从而防止布局太窄。
.wrapper {
width: 76.8%;
margin: 0 auto;
text-align: left;
max-width: 125em;
min-width: 62em;
}
对于图像,为了防止布局过大导致图像太大失真,可如下使图像不超过其原始尺寸。
img {
width: 80%;
max-width: 646px;
}
也可仅使用max-width:xx%,使其一直占用父级固定比例的宽度,且不超过其原始尺寸。
img {
max-width: 80%;
}
9.@font-face
@font-face让我们可以使用任何字体,而不需要考虑用户机器上是否安装了这种字体。
@font-face {
font-family: "My font";
src: url(css/Myfont.otf);
}
/*然后,就可以引入字体;*/
h1 {
font-family: "My font";
}
CSS拾遗(二)的更多相关文章
- 前端总结·基础篇·CSS(二)视觉
前端总结系列 前端总结·基础篇·CSS(一)布局 前端总结·基础篇·CSS(二)视觉 前端总结·基础篇·CSS(三)补充 前端总结·基础篇·CSS(四)兼容 目录 一.动画(animation)(IE ...
- css入门二-常用样式
css入门二-常用样式总结 基本标签样式 背景色background-color 高度height; 宽度width; 边框对齐以及详细设定举例 width/*宽度*/: 80%; height/*高 ...
- python day 22 CSS拾遗之箭头,目录,图标
目录 day 4 learn html 1. CSS拾遗之图标 2. html文件的目录结构 3. CSS拾遗之a包含标签 4. CSS拾遗之箭头画法 day 4 learn html 2019/11 ...
- 基本CSS布局二
基本CSS布局二------基本页面布局二 /*主面板样式*/ #container { width:100%; margin:0px auto;/*主面板DIV居中*/ } /*顶部面板样式*/ # ...
- Redis命令拾遗二(散列类型)
本文版权归博客园和作者吴双共同所有,欢迎转载,转载和爬虫请注明原文地址 :博客园蜗牛NoSql系列地址 http://www.cnblogs.com/tdws/tag/NoSql/ Redis命令拾 ...
- 前端之CSS(二)
一.盒子模型 说到盒子模型,我们不得不提一下,W3C标准和IE浏览器是有区别的,我昨天就在写抽屉作业的时候踩过坑,建议用谷歌浏览器,并推荐一篇博文:http://www.osmn00.com/tran ...
- 如何在普清的屏上调试CSS样式二倍图背景
背景: 最近就遇到一个同事的项目,还是像平常一样小心切图,认真对像素. 一切测试都没有问题,顺利上线. 但是,上线之后,产品经理跑过来说,有BUG. BUG描述:(不认为是BUG) 前端页面上的图标是 ...
- CSS 笔记二(Text/Fonts/Links/Lists)
CSS Text 1> Text Color used to set the color of the text 2> Text Alignment used to set the hor ...
- 数往知来 CSS<十二>
div+css基础 一.外部样式<!--外部样式可以使网页与样式分离,分工处理 1.写网页,主要提供内容,一般都会有固定的结构,具有id等属性的标签包括特定的内容 2.根据结构写样式另存为css ...
随机推荐
- Garbage Collection Optimization for High-Throughput and Low-Latency Java Applications--转载
原文地址:https://engineering.linkedin.com/garbage-collection/garbage-collection-optimization-high-throug ...
- LeetCode Algorithm 133_Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's ...
- 【例题 6-16 UVa 10129】Play on Words
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 入度减去出度个数为1的点和为-1的点各有1个,然后其他点入度减去出度为0 或者全都是入度为0的点即可. [代码] #include ...
- [Angular] Stagger animation v4.3.3
For example, when we open a form, we want to see all the inputs fields comes into one by one. Code f ...
- 安装后,挂载c盘失败
现象: 安装后,window C盘mount失败 错误内容如下: Error mounting: mount exited with exit code 13: ntfs_attr_pread_i: ...
- ios 不支持屏幕旋转
- (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; }
- [Angular] Angular Advanced Features - ng-template , ng-container, ngTemplateOutlet
Previously we have tab-panel template defined like this: <ul class="tab-panel-buttons" ...
- 怎样在一个fragment or 随意类中操作还有一个fragment中的方法
1 怎样在acitivty中运行fragment中的方法: 首先获得这个Fragment的对象 xxxFragment fragmentObject = (xxxFragment) getFragme ...
- POJ 1065 Wooden Sticks(zoj 1025) 最长单调子序列
POJ :http://poj.org/problem?id=1065 ZOJ: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId= ...
- SoC中的IP模块学习
SoC中的IP模块学习 理解IP Spec-->register定义,理解原理+架构框图 查看testcase+model(看已有的测试例程),分析操作/使用模块的流程,寄存器的配置方法 运行仿 ...