Problems:
We want to keep the content displayed center vertically in one container(div, a, p, span etc). The contents' height is less than the container's height.
height: 28px;
font-size: 12px;
Quite strange, the content will keep displayed at the top as below.
Even if we use, it still keep the same.
vertical-align: bottom;
vertical-align is not suppose to put the content in the middle of the container, but to be allign with what before and after. Here is an example:
http://www.w3school.com.cn/tiy/t.asp?f=csse_vertical-align
Solution:
Option 1. Set line-height to its height, then the line will be vertically alligned.
height: 28px;
line-height: 28px;
font-family: Arial;
font-size: 12px;
Option 2. Keep the container's height the same as the content's height and add paddings on top and bottom.
height: 12px;
font-size: 12px;
line-height: 12px;/*We still need line-height to keep it center vertically*/
padding: 7px 20px 7px 4px;
Related Patterns:
- 大小: 1.3 KB
- 大小: 1.1 KB
分享到:
相关推荐
语言:English 允许将列值从HTML表存储到剪贴板。 如果要复制表格上的值,请按照以下说明进行操作:1.在包含HTML表格的站点上选择...2.在表格上选择一列。3.在[表格上垂直复制]表格]-> [复制值]。 值将被复制到剪贴板上
Then, the bottom line waveguide of Su-8 with a flat top surface of 300 nm is created by etching. The thickness of Su-8 can easily be controlled by the etching time. Finally, by opening the window ...
-- vertically aligning icons --> <div style="font-size: 2rem;"> <div><i class="fas fa-skating fa-fw" style="background:DodgerBlue"></i> Skating <div><i class="fas fa-skiing fa-fw" style="background:...
-- vertically aligning icons --> <div style="font-size: 2rem;"> <div><i class="fas fa-skating fa-fw" style="background:DodgerBlue"></i> Skating <div><i class="fas fa-skiing fa-fw" style="background:...
We propose and fabricate a vertically integrated thermo-optic waveguide switch. It controls the optical path between two vertically stacked waveguides using the thermo-optic effect of optical polymer....
Designs of p-doped in quantum well (QW) barriers and specific number of vertically stacked QWs are proposed to improve the optical performance of GaN-based dual-wavelength light-emitting diodes (LEDs)...
### iOS Development with Swift: Key Concepts and Features The title and description "iOS Development with Swift 全英文" suggest a comprehensive guide on developing applications for iOS using the ...
like structures (SLS) in the horizontal directions, together with a traditional spring-mass-damper system assembled vertically with positive stiffness. With the mathematical modeling of the proposed ...
-size geometry width and height of image -stretch type render text with this font stretch -stroke color graphic primitive stroke color -strokewidth value graphic primitive stroke width -style ...
You have been provided with a third-party library "ChessLib" which calculates the legal moves a knight can make given a position on an 8 by 8 board. The library has been used to create a program which...
stem32 USBHID AC Mirror Vertical Sel - Mirror vertically AC Font Select Sel - Enable font select control AC Font Color Sel - Enable font color control AC Font Size Sel - Enable font size control AC ...
Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page ...
Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page ...
本文研究了在垂直振动容器中颗粒堆积物的形成与运输,特别是其中包含周期性凹凸底结构的系统。研究中涉及了两种不同类型的底部结构:一种是由十个相同的Plexiglas矩形凸起构成的周期性阵列,另一种是单步结构。...
Tmux垂直最大化用法这将绑定prefix + M以仅在垂直方向最大化窗格示范使用安装(推荐) 将插件添加到.tmux.conf中的TPM插件列表中: set -g @plugin 'tomskopek/tmux-maximize-vertically'按prefix + I提取插件并获取...
Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page ...
Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page ...
Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page ...