Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你不知道的css(三) #11

Open
z2014 opened this issue Jan 25, 2018 · 0 comments
Open

你不知道的css(三) #11

z2014 opened this issue Jan 25, 2018 · 0 comments
Labels

Comments

@z2014
Copy link
Owner

z2014 commented Jan 25, 2018

1.border

  • border-width不支持百分比

2.单位ex(相对字体和字号的单位)
利用ex使图标居中

.icon{
    display: inline-block;
    width: 20px;
    height: 1ex;
    background: url() no-repeat center
}

此时调节字体大小,图标都会居中
3.line-height

  • line-height就是内联元素的完全高度;是替换元素前一个空白幽灵节点的高度;块级元素无影响
  • line-height有数值,百分比值,长度值(em),都是相对于font-size计算得来,如果是数值,子元素继承的就是这个数值,而如果是其他,那么子元素继承的就是计算得来的值
@z2014 z2014 added the css label Mar 25, 2018
@z2014 z2014 changed the title 你不知道的css(三) 你不知道的css(三) Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant