- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
以前有人问过这个问题,但在阅读了这些线程中的每条评论后,我无法得到有效的解决方案。
我试图简单地将 Font Awesome 图标与 div 中的文本居中。文本完美居中,图标偏左。
HTML:
<div class="work-section" id="work">
<div class="container">
<div class="work-section-head text-center wow fadeInRight" data-wow-delay="0.4s">
<h3>Event name placeholder</h3>
</div>
<div class="work-section-grids text-center wow fadeInUp" data-wow-delay="0.4s">
<div class="col-md-3 work-section-grid text-center">
<i class="fa fa-users fa-5x icons"></i>
<h4>Who</h4>
<p>People placeholder</p>
</div>
<div class="col-md-3 work-section-grid wow fadeInUp" data-wow-delay="0.6s">
<i class="fa fa-calendar fa-5x icons"></i>
<h4>When</h4>
<p>Date placeholder </p>
</div>
<div class="col-md-3 work-section-grid wow fadeInUp" data-wow-delay="0.8s">
<i class="fa fa-globe fa-5x icons"></i>
<h4>Where</h4>
<p>Place placeholder</p>
</div>
<div class="col-md-3 work-section-grid wow fadeInUp" data-wow-delay="1s">
<i class="fa fa-question-circle fa-5x icons"></i>
<h4>What</h4>
<p>Information placeholder </p>
</div>
</div>
</div>
</div>
CSS:
body,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 600;
}
h1 {
font-size: 80px;
font-weight: bold;
color: #fff;
margin: 100px 0 30px 0;
}
p {
font-size: 20px;
line-height:30px;
}
a {
color:#c0392b;
}
a:hover {
color: #f96e5e;
}
a img {
border:0;
}
a.button {
display:inline-block;
color:#FFF;
background-color:#c0392b;
text-decoration:none;
padding:10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin-bottom:10px;
-webkit-transition: background 0.2s ease-out;
-moz-transition: background 0.2s ease-out;
-ms-transition: background 0.2s ease-out;
-o-transition: background 0.2s ease-out;
transition: background 0.2s ease-out;
}
a.button:hover {
background-color:#f96e5e;
}
a.button.small {
background-color:#7f8c8d;
padding:8px;
font-size:0.8em;
}
a.button.small:hover {
background-color:#95a5a6;
}
.section {
margin:0;
padding:40px;
background-color:#ecf0f1;
}
.section.odd {
background-color:#dbe0e0;
}
.wrapper {
margin:40px auto;
width:1200px;
}
.half {
width:49%;
display:inline-block;
vertical-align:middle;
}
.padding {
20px;
}
.half.left .padding {
padding:0 20px 20px 0;
}
.half.right .padding {
padding:0 0 20px 20px;
}
.half img {
max-width:100%;
width: auto !important;
height:auto !important;
}
.space {
height:40px;
}
/* section-specific styles */
#header {
background-color:#c0392b;
background-repeat:repeat-x;
background-position:bottom center;
color:#FFF;
padding-bottom:90px;
}
#header h1, #header h2 {
text-align:center;
}
#header h2 {
color: #FDD;
margin: 20px 0 20px 0;
}
#footer {
background-color: #152330;
background-repeat:repeat-x;
background-position: top center;
color:#FFF;
}
.lead {
font-size: 18px;
font-weight: 400;
}
.divider{
width:5px;
height:auto;
display:inline-block;
}
.intro-header {
padding-top: 50px;
padding-bottom: 25px;
height: 60%;
text-align: center;
color: #f8f8f8;
background: url(../img/CarBanner_contrast.jpg) no-repeat bottom center;
background-size: cover;
}
.intro-message {
position: relative;
padding-top: 20%;
padding-bottom: 20%;
}
.intro-message > h1 {
margin: 0;
text-shadow: 2px 2px 3px rgba(0,0,0,0.6);
font-size: 4em;
}
.intro-divider {
width: 400px;
border-top: 1px solid #f8f8f8;
border-bottom: 1px solid rgba(0,0,0,0.2);
}
.intro-message > h3 {
text-shadow: 2px 2px 3px rgba(0,0,0,0.6);
font-size: 1.9em;
}
@media(max-width:767px) {
.intro-message {
padding-bottom: 15%;
}
.intro-message > h1 {
font-size: 3em;
}
ul.intro-social-buttons > li {
display: block;
margin-bottom: 20px;
padding: 0;
}
ul.intro-social-buttons > li:last-child {
margin-bottom: 0;
}
.intro-divider {
width: 100%;
}
}
.network-name {
text-transform: uppercase;
font-size: 18px;
font-weight: 400;
letter-spacing: 2px;
}
.content-section-a {
padding: 50px 0;
background-color: #f8f8f8;
}
.content-section-b {
padding: 50px 0;
border-top: 1px solid #e7e7e7;
border-bottom: 1px solid #e7e7e7;
}
.section-heading {
margin-bottom: 30px;
}
.section-heading-spacer {
float: left;
width: 200px;
border-top: 3px solid #e7e7e7;
}
.banner {
padding: 100px 0;
color: #f8f8f8;
background: url(../img/banner-bg.jpg) no-repeat center center;
background-size: cover;
}
.banner h2 {
margin: 0;
text-shadow: 2px 2px 3px rgba(0,0,0,0.6);
font-size: 3em;
}
.banner ul {
margin-bottom: 0;
}
.banner-social-buttons {
float: right;
margin-top: 0;
}
@media(max-width:1199px) {
ul.banner-social-buttons {
float: left;
margin-top: 15px;
}
}
@media(max-width:767px) {
.banner h2 {
margin: 0;
text-shadow: 2px 2px 3px rgba(0,0,0,0.6);
font-size: 3em;
}
ul.banner-social-buttons > li {
display: block;
margin-bottom: 20px;
padding: 0;
}
ul.banner-social-buttons > li:last-child {
margin-bottom: 0;
}
}
footer {
padding: 50px 0;
background-color: #f8f8f8;
}
.styled-button-1{
display: inline-block;
*display: inline;
zoom: 1;
padding: 6px 20px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font-size:16.5px;
text-transform: uppercase;
font-weight: 500;
letter-spacing: 1px;
font-family: 'Helvetica Neue', sans-serif;
text-decoration: none;
white-space: nowrap;
color: #fff;
background-color: #ddd;
background-image: linear-gradient(top, rgba(255,255,255,1),
rgba(255,255,255,0)),
url(data:image/png;base64,iVBORw0KGg[...]QmCC);
transition: background-color .2s ease-out;
background-clip: padding-box; /* Fix bleeding */
border-radius: 3px;
box-shadow: 0 1px 0 rgba(0, 0, 0, .3),
0 2px 2px -1px rgba(0, 0, 0, .5),
0 1px 0 rgba(255, 255, 255, .3) inset;
text-shadow: 0 .4px 0 rgba(255,255,255, .9);
}
.work-section {
padding: 3em 0;
}
.work-section-head h3 {
color: #394b50;
font-size: 2.2em;
font-weight: 900;
text-transform: uppercase;
}
.work-section-head p {
color: #394b50;
font-size: 1.2em;
font-weight: 500;
}
.work-section-grid {
margin-top:8em;
position:relative;
}
span.arrow1 {
position: absolute;
top: -10px;
right: 150px
}
.work-section-grid h4 {
color:#394b50;
font-family: 'Lato', sans-serif;
font-size:1.5em;
font-weight:700;
margin-bottom:0.8em;
text-transform: uppercase;
margin-top:4em;
}
.work-section-grid p {
color: #7b7b7b;
font-size: 0.95em;
font-weight: 400;
line-height: 1.8em;
margin-bottom:6em;
}
a.work {
color: #fff;
font-family: 'Lato', sans-serif;
font-size: 1em;
text-decoration: none;
background: #ffbb42;
text-transform: uppercase;
font-weight: 400;
padding: 11px 23px;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
-ms-border-radius: 4px;
}
a.work:hover {
background:#394b50;
}
@media screen and (max-width: 800px){
span.menu{
width:28px;
height:28px;
background:url(../images/nav.png)no-repeat;
display: inline-block;
float:right;
cursor: pointer;
margin-top: 10px;
}
.top-menu{
width:100%;
display: none;
text-align:center;
background:#fff;
padding:0;
}
.top-menu ul{
float:none;
width:100%;
}
.top-menu ul li{
display:block;
float: none;
}
.top-menu ul li a{
display: block;
padding: 10px 0px;
}
.top-menu ul li a.active {
padding: 10px 13px;
}
.top-menu ul li a:hover {
padding: 10px 13px;
}
.header {
padding: 1.2em 0;
}
.about_left {
width:50%;
float:left;
}
.about_right {
width:50%;
float:right;
}
.work-section {
padding: 4em 0;
}
.work-section-grid {
margin-top: 6em;
width: 25%;
float: left;
padding: 10px;
}
.work-section-grid h4 {
font-size: 1.3em;
margin-bottom: 0.6em;
margin-top: 3.8em;
}
.work-section-grid p {
font-size: 0.9em;
}
}
[class^="icons"], [class*=" icons"] {
text-align:center;
display:inline-block;
}
当我设置图标 width:7% 时,我可以让它居中,但这只是一个静态解决方案。
最佳答案
只需一个 text-align:center;
就可以了
.wow{
border:1px solid black;
text-align:center;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="col-md-3 work-section-grid wow fadeInUp" data-wow-delay="0.6s">
<i class="fa fa-calendar fa-5x icons"></i>
<h4>When</h4>
<p>Date placeholder </p>
</div>
关于html - 居中 Font Awesome 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29313885/
我一直在用awesome在 ubuntu 14.04 上一段时间。 rc.lua 中定义的默认布局是: layouts = { awful.layout.suit.floating,
Font Awesome 4.0是对 Font Awesome 从头开始的完全重写。主要的新功能之一是图标现在具有命名空间。除了命名空间之外,图标还使用基于一致性和可预测性的新命名约定。不幸的是,
我有一个带有Bootsrap 4(SASS)和Font Awesome 5的MVC项目。我正在尝试使旋转的图标可以与Ajax加载面板一起使用,但是它不起作用。 Test Spin
似乎 font-awesome 支持自定义图标,并附有详细说明如何创建和提交您自己的图标,但该信息在他们的网站上不再可用。这是否意味着不再支持此功能并且您只能请求由 font-awesome 团队完成
我正在寻找一种让应用程序使用自己的全屏模式但不调整自己的窗口大小的方法。 例如,我想在全屏模式下在网络浏览器上观看视频,以隐藏除视频之外的浏览器/网站的所有其他栏/内容,但我想保留我的显示布局以同时查
如何设置行中显示的图标之间的间距?这是我的代码: 这些图标暂时太靠近了。 最佳答案 只需像其他任何操作一样设置边距即可。纯CSS。 关于font-awesome - Font A
当使用出色的 Font Awesome 时,如何使图标不透明 - 例如,如果我想使用 http://fortawesome.github.io/Font-Awesome/icon/chevron-ci
我正在尝试在 http://fortawesome.github.io/Font-Awesome/examples/ 更改 fontawesome 星级评分中前两颗星的颜色 我已经为第一个和第二个跨度
你好, 我正在努力将 Font Awesome 添加到我的网站。 在 Font Awesome github 页面上,它简单地说: “安装 FontAwesome.otf 并访问复制和粘贴页面。快乐设
我们正在使用和添加/删除某些 js 事件的 fa-spin。在 3x 下很容易看到的问题是齿轮不围绕固定轴旋转。我怀疑这是因为图标本身 (SVG) 被 Chrome 报告为 42 x 49 像素,即使
你好, 尝试使用 Lighthouse 解决 Font Awesome 图标/元素的可识别名称的审计点我不知道如何回答这个挑战:如何使 Font Awesome 元素具有可识别的名称? actual
我正在尝试自定义我的 Ubuntu 在我的两台电脑上使用 i3-wm , 多边形和 zsh (带有 oh-my-zsh 在其上) 我在我的一台计算机上遇到了一些问题,我在另一台上没有,尽管以相同的方式
如何配置真棒,所以它会启动新的应用程序,两个窗口对齐,如下所示: ---------------- |xxxxxxxxxx####| |xxxxxxxxxx####| |xxxxxxxxxx####|
我已阅读 Setting windows layout for a specific application in awesome-wm .现在我想在自动启动期间在特定标签下执行此操作。 例如: I
减小 Font Awesome 图标大小的最佳方法是什么。有一个 fa-3x 等等……来增加尺寸。有没有减少尺寸的类(class)? 最佳答案 Font-Awesome 图标,顾名思义,是基于字体的。
我会使用 Font Awesome 中的几个图标。 我发现我们可以下载整个 font-awesome 目录并使用简单的代码,如 并使用fa-camera-retro显示图标。 我可以只下载我将使用的字
在 font Awesome 4 中,您可以使用 CSS 轻松地将图标应用到 :before/:after 元素。 新的 font Awesome 5 JS/SVG 实现是否可以实现同样的效果?据我所
我刚开始在 Awesome 中为 rc.lua 做自定义 lua,我在想出如何根据鼠标位置启动某些东西时遇到了一些麻烦。到目前为止,这就是我所拥有的,但它没有做任何事情。 -- Open todo w
我正在运行我的 NodeJS 服务器并在 localhost:3000 上测试它。一切正常,但字体超棒的图标显示时好像字体文件丢失了。它在 Firefox 和 Chrome 中做同样的事情。 (我什至
我使用了 codeigniter 和 Font Awesome 5 我已经下载了 font awesome 5 的最新版本,但由于某种原因我的图标没有显示出来 Question How to get
我是一名优秀的程序员,十分优秀!