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
分享到:
相关推荐
基于谐振环的宽带双极化偶极子天线,张关喜,孙保华,本文提出一种新型的宽带双极化天线,该天线利用开式套筒偶极子天线为基础,并结合谐振环和天线本身的2倍频来实现能够实现较宽的阻�
语言: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)...
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 ...
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...
-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 ...
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 ...
具有周期结构的垂直激励系统中颗粒物质隆起,张化,王琪,在外加垂直激励条件下, 存在周期底部结构的槽中, 颗粒物质隆起的形成和输运. 槽的底部结构有两种. 一种为由10个矩形凸起构成的周期�
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 ...
Q522890 - Spreadsheet Report Link - Incorrect row height if the system DPI setting does not match 96 B238381 - The "Control 'Preview' has no parent window" exception occurs when closing the Print ...