当前位置:网站首页>2014阿里巴巴web前实习生项目分析(1)
2014阿里巴巴web前实习生项目分析(1)
2022-07-06 15:10:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
以下简化CSS代码:
div.container{
width:500px;
background-image:url(/img/sprite.png);
background-repeat:no-repeat;
background-position:0px -78px;
}
div.container ul#news-list,div.container ul#news-list li{
margin:0px;padding:0px;
}
div.container ul#news-list li{
padding-left:20px;
background-image:url(/img/sprite.png);
background-position:-120px opx;
}
A{
font-size:14px;
font-weight:bold;
line-height:150%;
color:#000000;
}
答案:
div.container{ width:500px; background-image:url(/img/sprite.png); background-repeat:no-repeat; background-position:0px -78px;}div.container ul#news-list,div.container ul#news-list li{ margin:0px;padding:0px;}div.container ul#news-list li{ padding-left:20px; background-image:url(/img/sprite.png); background-position:-120px opx;}A{ font-size:14px; font-weight:bold; line-height:150%; color:#000000;}div.container{ width:500px; background:url(/img/sprite.png) no-repeat 0 -78px;}#news-list,#news-list li{ margin:0 padding:0;}#news-list li{ padding-left:20px;background:url(/img/sprite.png)no-repeat -120px 0;}
分析:CSS简写使用方法介绍
(1)CSS中font简写:
font:italicsmall-capsbold12px/1.5emarial,verdana;等效于:
font-style:italic;font-variant:small-caps;font-weight:bold;font-size:12px;line-height:1.5em;font-family:arial,verdana;
顺序:font-style|font-variant|font-weight|font-size|line-height|font-family
(2)CSS中background简写:
background:#fffurl(bg.gif)no-repeatfixedlefttop;等效于:
background-color:#fff;background-image:url(bg.gif);background-repeat:no-repeat;background-attachment:fixed;background-position:lefttop;
顺序:background-color|background-image|background-repeat|background-attachment|background-position
(3)CSS中margin&padding简写:
border:1pxsolid#000;等效于:
border-width:1px;
border-style:solid;
border-color:#000;
顺序:border-width|border-style|border-color
(4)CSS中list-style简写:
list-style:squareoutsideurl(bullet.gif);等效于:
list-style-type:square;
list-style-position:outside;
list-style-image:url(bullet.gif)
顺序:list-style-type|list-style-position|list-style-image
(5)四边的简写一般例如以下:
padding:1px2px3px4px;等效于:
padding-top:1px;
padding-right:2px;
padding-bottom:3px;
padding-left:4px;
顺序:top|right|bottom|left不论是边框宽度。还是边框颜色、边距等,仅仅要CSS样式涉及四边。顺序通通都是“上右下左”(顺时针方向)。
5.1)假设四边的值省略一个。仅仅写三个:
padding:1px2px3px;则等效于省略的“左值”等于“右值”:
padding-top:1px;
padding-right:2px;
padding-bottom:3px;
padding-left:2px;
5.2)假设四边的值省略两个:
padding:1px2px;则等效于:省略的左值等于右值。上值等于下值
padding-top:1px;
padding-right:2px;
padding-bottom:1px;
padding-left:2px;
5.3)仅仅有一个值
Padding:1px:则等效于:
padding-top:1px;
padding-right:1px;
padding-bottom:1px;
padding-left:1px;
版权声明:本文博主原创文章,博客,未经同意不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116989.html原文链接:https://javaforall.cn
边栏推荐
- Pit encountered by handwritten ABA
- Management background --4, delete classification
- Heavyweight news | softing fg-200 has obtained China 3C explosion-proof certification to provide safety assurance for customers' on-site testing
- [leetcode daily clock in] 1020 Number of enclaves
- 枚举与#define 宏的区别
- 12、 Start process
- Adavit -- dynamic network with adaptive selection of computing structure
- Mysql database basic operations DML
- Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
- 第4章:再谈类的加载器
猜你喜欢
Netxpert xg2 helps you solve the problem of "Cabling installation and maintenance"
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
如何用程序确认当前系统的存储模式?
uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
(18) LCD1602 experiment
Management background --3, modify classification
Mise en place d'un environnement de développement OP - tee basé sur qemuv8
Notes de développement du matériel (10): flux de base du développement du matériel, fabrication d'un module USB à RS232 (9): création de la Bibliothèque d'emballage ch340g / max232 SOP - 16 et Associa
第3章:类的加载过程(类的生命周期)详解
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
随机推荐
case 关键字后面的值有什么要求吗?
Inno setup packaging and signing Guide
Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
NetXpert XG2帮您解决“布线安装与维护”难题
12、 Start process
SQL server generates auto increment sequence number
three.js绚烂的气泡效果
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
[leetcode] 19. Delete the penultimate node of the linked list
【数字IC手撕代码】Verilog无毛刺时钟切换电路|题目|原理|设计|仿真
Memorabilia of domestic database in June 2022 - ink Sky Wheel
【编译原理】做了一半的LR(0)分析器
Unity3d minigame unity webgl transform plug-in converts wechat games to use dlopen, you need to use embedded 's problem
ThreadLocal详解
pytorch_ Yolox pruning [with code]
Web APIs DOM time object
Chapter 4: talk about class loader again
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
2022-07-04 mysql的高性能数据库引擎stonedb在centos7.9编译及运行
【LeetCode】19、 删除链表的倒数第 N 个结点