Producing a timezone icon using fontawesome - font-awesome

Has anyone ever done a nice looking timezone icon with font-awesome? I was thinking perhaps the world and time together, but I cannot get it looking nice.
<span class="fa-stack">
<i class="fa fa-globe fa-stack-2x"></i>
<i class="fa fa-clock-o fa-stack-1x"></i>
</span>
The above is maybe a starting point but I would have to change colors or something, or maybe style them myself side by side rather than stacked- so I wondered if someone already had something that looked good? It does not need to be world and time, could be something else that means timezone to a user.

Something like this. The key is to get the colors to be different enough that the clock stands out, and to put the clock in an appropriate spot.
<span class="fa-stack">
<i class="fa fa-globe fa-stack-2x"></i>
<i class="fa fa-clock-o fa-stack" style="color: #ccc; text-align: right; margin-right: 0.35em; margin-top: 0.25em; right: 0; position: absolute;"></i>
</span>
https://jsfiddle.net/01h9p7xx/

Related

Font awesome stacking square and square-o don't align

I'm trying to make this using font-awesome stacking
I've tried two ways, but both are ugly. The problem is that fa-square and fa-square-o are different sizes, so when you stack them, they don't line up!
my fiddle
<span class="fa fa-stack">
<i class="fa fa-square fa-stack-1x"></i>
<i class="fa fa-plus-square fa-stack-1x fa-inverse"></i>
<i class="fa fa-square-o fa-stack-1x"></i>
</span>
<span class="fa fa-stack">
<i class="fa fa-square fa-stack-1x fa-inverse"></i>
<i class="fa fa-plus-square-o fa-stack-1x"></i>
</span>
The result is
I have tried to scale down the fa-square by 86% using css. However, that is very fragile, because it depends on the browser and the zoom setting. I would like the solution to look good on both Chrome and IE11 at multiple zoom levels.
This might help.
body {
background-color: tan;
font-size: 100px;
}
.fix:before {
background: #000;
border-radius: 20%;
padding: 1% 5%;
}
.fix-2:before {
background: #000;
border-radius: 20%;
padding: 1% 10%;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<span class="fa fa-stack">
<i class="fa fa-square fa-stack-1x fix"></i>
<i class="fa fa-plus-square fa-stack-1x fa-inverse"></i>
</span>
<!-- Without Stacking -->
<i class="fa fa-plus-square fa-inverse fix-2"></i>
Unfortunately, if you want to use the icons of Font-Awesome, you will have to contribute to the project by making a new generation of fa-square and all the derivatives (rss-square, ...) to standardize the size of the icons.
Developers no longer accept pull-request for icons so it may take a long time before it is accepted. (As Hugues M. said, it's a known bug)
The workarounds I see:
Create your own icon based on a font (see this post), override the square unicode (f0c8) or get an other free one. (and push your solution in github). It is generic, you can dynamically change the color but it take a long time.
Or simply make an image (SVG or something else) for your project, it's quick but less malleable.

How create a multiple fa-icon

I need to put multiple fa icon a trophy that must be the container and inside a number. Something like this:
https://img.clipartfest.com/fc3163ee61d664e212d4bb9764702efa_trophy-clipart-black-and-white-trophy-number-1-clipart_1920-1920.jpeg
The code that I use is ( but is not work) :
<!-- create trophy -->
<i class="fa fa-trophy fa-4x" aria-hidden="true" style="color:#FF8000;"><span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-stack-1x">1</i>
</span>
</i>
it is not work because the cirle is very big and it appears near to trophy and not above the trophy also the number 1 appears near the circle? Anyone can help me?
I believe you want something like this?
<i class="fa fa-trophy fa-2x"style="color:#FF8000;vertical-align:middle"></i>
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-stack-1x"style="color:#FF8000;">1</i>
</span>
The sizes can be changed with the font awesome classes. The font awesome stacking works by placing elements on increasing layers, so the first thing in the span will be on the bottom.
EDIT: moved trophy out and added styling to it. Although you generally shouldn't do styling like this
Your markup is wrong, try the following:
.trophy {
position: relative;
/* Parent needs to be taken out of normal document flow to center the number*/
}
.trophy__icon {
color: #FF8000;
}
/* Class to center the number */
.trophy__number {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: -6%;
text-align: center;
font-size: .5em;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<span class="fa-stack fa-lg trophy">
<i class="fa fa-circle fa-stack-2x trophy__background"></i>
<i class="fa fa-trophy fa-stack-1x trophy__icon"></i>
<div class="trophy__number">1</div>
</span>

Toggling between Font Awesome styles on hover

I'm an aspiring web designer and need help with an issue I'm having. I have an icon in Font Awesome that I want to change colour/style when I hover on it.
Here is the default style I'd like to use:
CSS
.fa-circle {
color:red;
}
HTML:
<span class="fa-stack fa-5x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-arrow-right fa-stack-1x fa-inverse"></i>
</span>
http://jsfiddle.net/94n0zxbt/2/
and here is what I'd like to have it change to on hover:
http://jsfiddle.net/94n0zxbt/5/
CSS
.fa-circle {
color:white;
border-color: red;
border-radius: 90px;
border-style: solid;
}
.fa-arrow-right {
color: red;
}
HTML
<span class="fa-stack fa-5x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-arrow-right fa-stack-1x fa-inverse"></i>
</span>
Thanks,
Ashley
The reason the normal :hover css isn't working is that the <i> tags are overlapping each other. If you put the arrow <i> tag inside the circle <i> it will work:
http://jsfiddle.net/pjpwea/94n0zxbt/6/
You will notice that the arrow has gotten twice as big (I assume this is from the '2x' class), not super familiar with Font Awesome but there is probably an easy fix.

Unable to move icon inside the circle

I am trying to place fa-graduation-cap inside a circle.
So, that means:
<span class="fa-stack">
<i class="fa fa-circle fa-stack-4x text-primary"></i>
<i class="fa fa-graduation-cap fa-2x"></i>
</span>
But it doesn't work. The output is this:
The graduation-cap is outside the circle. Why is that?
Note:
text-primary is the bootstrap class for color.
You're not applying those classes in the correct way/order.
Following the code from the examples, here we go.
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x text-primary"></i>
<i class="fa fa-graduation-cap fa-stack-1x fa-inverse"></i>
</span>
If you want it to be bigger just add a class fa-2x, fa-3x, fa-4x or fa-5x to the span, nothing else.
Check it on this fiddle.
How are you trying to put the elements together with CSS ?
you probably need to position the icons individually to place them where and how you want them. This could possibly be done with the following:
.fa-stack{position: relative;}
.fa-circle{position:absolute; top: 10px; left: 10px;}
.fa-graduation-cap{position:absolute; top: 20px; left: 10px;}
you can move the icons over the screen by changing the pixels in the top value and the left value for example.

Bootstrap v3.3.0 Columns Too Wide

I've been really frustrated over the issue, searched many options, found none to work, and do not have the heart to ponder over it further.
The website in question is https://flix-c9-airbusai342.c9.io/.
Here, I'm having issues with the columns being too wide in mobile. Yes, they are properly stacking, however, not sure what's causing it to be too wide.
Below is a direct snippet of the code of the area in question. The class .stats is onlybackground-color: #D8D8D8; for changing background color.
<section class="stats">
<div class="container-fluid">
<div class="row-fluid">
<div class="col-md-4" align="center">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x turquoise"></i>
<i class="fa fa-code fa-stack-1x fa-inverse"></i>
</span>
<h2>Professional Coding</h2>
<span class="text-muted"><p>A team of experienced web developers are ready to give you the best quality code available to be provded for you. <b>Each</b> and <b>every</b> time.</p></span>
</div>
<div class="col-md-4" align="center">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x turquoise"></i>
<i class="fa fa-bolt fa-stack-1x fa-inverse"></i>
</span>
<h2>Dedicated Team</h2>
<span class="text-muted"><p>Nothing's perfect. Even us. Thus, our dedicated team is ready to help you whenever you need it, even if it means sacrificing leasure time.</p></span>
</div>
<div class="col-md-4" align="center">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x turquoise"></i>
<i class="fa fa-mobile fa-stack-1x fa-inverse"></i>
</span>
<h2>Mobile compatible</h2>
<span class="text-muted"><p>We know the new trends of websites. Meeting popular demand, our websites by default look great on any device across. Even this website.</p></span>
</div>
</div>
</div>
I openly allow you to view the page source of the website.
Thank you for any assistance; my dull mind is suffering. :)
You have a min-width of 960px on your .section
Removing that will solve a lot of things. If you do not want your content to stretch to the full width of the window, use a max-width: 960px; instead. Otherwise, just remove the min-width of 960px
Remove .row-fluid and use .row.
Remove align="center" that's old stuff
Use .text-center on the parent of the stuff you want centered (provided it's inline or inline-block elements)
Use .center-block on any block elements (like an .img-responsive).