【发布时间】:2016-08-23 04:33:43
【问题描述】:
我搜索了有关 stackoverflow 的问题,但我尝试过的问题都没有。他们中的大多数扭曲了我真正想要实现的目标。我想知道我哪里出错了或者我错过了什么。
我尝试的一些链接是: CSS align images and text on same line、Image and text on same line?等
我尝试并删除了它们。我正在展示我自己取得的成就。
我想达到什么目标?
1) 我希望文本自动调整大小,即使容器大小发生变化。
2) 当文本调整大小时,它应该保持缩进。
示例:
|img|--|文本行 1|
|文本行 2|
注意: 我使用字体真棒图标集作为图像。
更新: Paulie_D 回答有效,但没有响应。检查http://design.google.com/resizer/#device=handset&url=http%3A%2F%2Fhungry.pe.hu%2Fhelp&width=720
#org_info_container {
background-color:#FFFFFF;
border: 1px #CCCCCC solid;
-moz-box-shadow: 0px 0px 2px #C0C0C0;
-webkit-box-shadow: 0px 0px 2px #C0C0C0;
box-shadow: 0px 0px 2px #C0C0C0;
margin-right: 5%;
margin-top:20px;
width:28%;
float:right;
}
#org_info_details {
padding-left: 10px;
padding-right: 10px;
font-family: 'Montserrat';
font-size: 14px;
}
.group {
margin-bottom: 20px;
}
.icon {
color: #ED734F;
margin: 3%;
display: inline;
}
.text {
display: inline;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" rel="stylesheet" />
<div id="org_info_container">
<div id="org_info_details">
<div class="group">
<div class="icon"><i class="fa fa-envelope-o fa-lg fa-fw"> </i>
</div>
<div class="text"><a href="mailto:support@hungry.pe.hu" class="help">support@hungry.pe.hu</a> | Email us</div>
</div>
<div class="group">
<div class="icon"><i class="fa fa-phone fa-lg fa-fw"> </i>
</div>
<div class="text"><a href="tel:9836345939" class="help">XXXXXXXXXX</a> | Call us</div>
</div>
<div class="group">
<div class="icon"><i class="fa fa-map-marker fa-lg fa-fw"> </i>
</div>
<div class="text"><strong>505, Phulpukur Road, Chinsurah, Hooghly, 712101</strong> | Main Office</div>
</div>
</div>
</div>
【问题讨论】:
标签: css image responsive-design font-awesome text-alignment