【发布时间】:2018-04-04 17:59:37
【问题描述】:
我对 css 很陌生,我无法将 mat-icon(思想泡泡)与 div class=img(左侧的绿色方块)对齐 - 请参阅附图。此时图标有点靠近顶部
为了添加 svg 图标,我使用了 Material Angular - MatIconRegistry 类(不知道是否重要)
这是我的html:
<div class="container">
<div class="img"><mat-icon svgIcon="info"></mat-icon></div>
Some text here!
</div>
这是我的 CSS:
$conainer-min-width: 256px !default;
$conainer-max-width: 512px !default;
$conainer-height: 50px !default;
div.container {
max-width: $container-max-width;
min-width: $container-min-width;
height: $container-height;
margin: auto;
color: #000000;
background-color: #ffffff;
line-height: $container-height;
text-align: center;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-width: 1px;
border-style: solid;
border-color: #9e9e9e;
padding-right: 20px;
position: fixed;
z-index: 1000;
left: 0;
right: 0;
top: 30px;
}
div.img {
width: $container-height;
height: $container-height;
float: left;
display: block;
margin: 0 auto;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #9e9e9e;
line-height: $container-height;
justify-content: center;
background-color: #3f9c35;
}
关于如何解决此问题的任何想法?
【问题讨论】:
标签: html css angular-material