Adding a twitter icon in html page - html

How to generate the twitter , facebook and youtube icon as in the top of the website
https://store.linefriends.com/
If I inspect the element I see the following html :
<li></li>
Not sure how that icon gets generated from this html line as there is no image etc here

Such icons can be generated using an icon library. The most popular choice is FontAwesome. If you want to add links, you can enclose i tag with an anchor tag, with href attribute. You need to add a bit of styling to it.
a{
color: black;
text-decoration: none;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<div class="container">
<span><i class="fab fa-twitter"></i></span>
<span><i class="fab fa-facebook-f"></i></span>
<span><i class="fab fa-youtube"></i></span>
<span><i class="fab fa-instagram"></i></span>
</div>
You can get the code for link tag from cdnjs
You can search for all icons on their website
You can also download icons and use img tag, but using an icon library, makes things a lot easier.

You use a font family ("Turbo" as I can see) that contains web icons inside.
The icon is generated from the class icon-twitter. Inside this <a> element there is a .icon-twitter::before pseudo element that contains the content value content: "\ea96";. This value is being interpreted to this icon.
So, if you want to change this icon you have to remove the icon-twitter class and put an <img> element with your custom image file ( I would recommend to be an svg file for better load time performance ).

you will need to check each css file found in inspect element via view source for class icon-twitter. (with code like )
Or
Use font awesome for this. More details are available on https://fontawesome.com/
Fon awesome alternatives are available on https://www.google.com/amp/s/www.hongkiat.com/blog/free-font-icons-to-bookmark/amp/ OR https://alternative.me/font-awesome
Or
You can use images to achievs this with tag

Related

<i> tag icons are not displaying in my Ionic page

I am trying to use tag icon in the html but it's not showing the icon.
This is how I am trying to display the icon but it's not displaying the icon
<i class="fas fa-plus"></i>
But whereas if I use icon like below it's displaying the icon
<fa-icon [icon]="['fas','plus']"></fa-icon>
But I need to display Icon as in the below type in order to do my logics.
<i class="fas fa-plus"></i>
Any Help, Thanks!
You need to make sure that the font awesome library is properly loaded on the page. If you are using the Angular CLI, you can add the following line to the section of your HTML file:
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
Once the library is loaded and available, you can use the tag to display the icon.
You must be missing an link tag in the header of the index.html. Also try to use:
<i class="fa fa-plus"></i>
When I'v tried to use the i tag for icons, i noticed the "fas" was not working for me. I had to remove the "s"

How to use the font-awesome library

I might be asking a dumb question, but I am a newbie in javascript and its libs.
I came across the same problem as this post, and in the accepted answer, there was this line
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
However, after adding this line I have a navbar icon even though I did not include a img in my html. I also cannot manipulate the position of this icon built with this stylesheet. Can anyone explain what it does in this context? (referring to the post) I noticed that without this line of code the CSS and Javascript cannot be applied to a simple
<img class="search" src="icon.png" width="30" height="30">
And how is it possible for me adjust the location of the icon with this line of code?
font awesome is a css sheet, that when you use "font awesome classes" on a particular element, makes an icon appear. there's no jpgs or anything to mess with.
<i class="fa fa-address-book" aria-hidden="true"></i>
in a plain html, this will do nothing. but if you add the stylesheet to the page, you will see an address book icon.
all icons are located here: http://fontawesome.io/icons/

Social media icons in HTML and CSS

I have a design below having some social media icons (LinkedIn, Facebook, Google Plus, Twitter) which I am trying to replicate in HTML and CSS.
At this moment, I am able to get this in fiddle in font-awesome but it's not the same design.
I am wondering, is there any way in font-awesome we can replicate the above design? If it is not possible in font-awesome, then can we replicate the above design through some other library?
The HTML code in fiddle which I am using for every social media icon is:
<li class="navbar-icons">
<a href="" target="_blank">
<i class="fa fa-linkedin-square fa-6" aria-hidden="true"></i>
</a>
</li>
Since you're using Font Awesome the result is gonna have a different design, because that solution has the purpose of providing icons and not the kind of buttons you really want.
If you'd like to maintain the style of the each social media platform, you should go through the respective docs.
Twitter
As stated in the Twitter docs, you should start by adding the following snippet
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet">
Tweet</a>
and, then add Twitter for Websites JavaScript, which handles the styling of the button, and change the URL in the href attribute to be the one you need.
Google+
The most simple button provided by their docs is the following
<script src="https://apis.google.com/js/platform.js" async defer></script>
<g:plus action="share" href="https://www.example.com"></g:plus>
where the href attribute contains the URL to be shared.
Facebook and LinkedIn
Both (Facebook and LinkedIn) have very easy to use generators that will produce the code snippet you need to add to your HTML.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

Have Two Font Awesome Icons in One i Tag

I've been scouring the web, and I can't find an answer to this. Is there away to add two Font Awesome icons in one i tag?
I can do it if I put two i tags side by side, like this:
Good for: <i class="fa fa-male fa-2x"></i><i class=" fa fa-female fa-2x"></i>
So is there anyway to do this?
Glyph-based fonts like this generally function by changing the content of the element to a specific value, which the font picks up and renders as the appropriate glyph.
So it's unlikely that you'll be able to use a single tag to display both of them unless the library provides specific syntax for handling that behavior on it's own (similar to how Font Awesome uses stacking).
This is not possible in a single <i> tag, reason is the way how the glyph identifying classes are applied. For longer or dynamic sequences you can however directly use the icons codes in markup notation:
html: <span class="font-awesome">&#xf183&#xf182</span>
css: .font-awesome { font-family: FontAwesome; }
This obviously requires that you load the font as FontAwesome.
I created a fiddler as simple demonstration: https://jsfiddle.net/6ofmn36g/
I do agree though that this is an approach that is somewhat hard to read, though...
With Font Awesome 5, it's possible!
Masking
Combine two icons create one single-color shape, thanks to the power of SVG in Font Awesome 5! Use it with our new Power Transforms for some really awesome effects.
Go through the Masking section in this link.
The below snippet is a small working example taken from their site
<!-- Important : Use the SVG & JS method and reference the Js file, not the CSS file -->
<script src="https://use.fontawesome.com/releases/v5.0.13/js/all.js"></script>
<div class="fa-4x">
<i class="fas fa-pencil-alt" data-fa-transform="shrink-10 up-.5" data-fa-mask="fas fa-comment" style="background:MistyRose"></i>
<i class="fab fa-facebook-f" data-fa-transform="shrink-3.5 down-1.6 right-1.25" data-fa-mask="fas fa-circle" style="background:MistyRose"></i>
<i class="fas fa-headphones" data-fa-transform="shrink-6" data-fa-mask="fas fa-square" style="background:MistyRose"></i>
</div>
Not possible with current library of FontAwesome. But there are work arounds as arkascha has suggested below.
Additional Info:
Not exactly what you are asking for But I think this will help you, Also future crowd who falls into this thread with the title.
I had answered similar stuff... Here
https://stackoverflow.com/a/36491858/2592042
You can also build a custom icon by using set of icons available in the font-awesome icon set by stacking and aligning them accordingly. Stacked Icons
Example:
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<span class="fa-stack fa-lg">
<i class="fa fa-male fa-stack-1x"></i>
<i class="fa fa-female fa-stack"></i>
</span>

Font Awesome showing and not showing (concrete5)

My website runs on Concrete5.
I wanted to add some more Font Awesome icon to an existing page, but it's not showing. Strange thing is, there already are icons on my webpage and they are showing...
However when I edit the block with the icons in it to check the HTML, there is no HTML/CSS saying the icons should be there!
When I add an icon in the content block in HTML, nothing shows. But when I add an icon with an HTML block it does show.
For instance the tree columns underneath the green picture show three green check boxes.
And this is what the content block says is in the block:
<p>Sessie 1</p>
<p>Analyse van je proces van vliegangst en je omslagpunt</p>
<p>Stoppen van de angst, piekeren en vervelende herinneringen</p>
<p>Praktische oefeningen voor thuis</p>
See the website here
As you can see, there is no font-awesome css in there. But icons are showing on the webpage. The css is also showing when you check the html of the page.
Now, if I would put
<p> <i class="fa fa-camera-retro"></i> test</p>
In the same block (a content block, in the html window). It won't show a camera. It would just show "test".
If I then go back to the content block and see what's in the html, it says
<p>test</p>
Now if I would put the same line of code in an HTML block, it does show the camera icon.
So there are two things happening:
Older font-awesome icons are showing on the webpage but not in the content blocks html.
New font-awesome icons can't be added through html in content blocks, but can in HTML blocks.
Edit: When I use this code:
<p class="fa fa-camera-retro"></p>
It does show in the content block. But then I can't simply add a symbol with some text, because the font will be from the font-awesome font.
the <i> tag still isn't working.
so
<i class="fa fa-camera-retro"></i>
Gives nothing.
The icons only appear when there's text between the code:
<i class="fa fa-camera-retro">foo</i>
However, the editor changes the <i> tag then to an <em> tag. And 'foo' then has the font-awesome font. Not the font of my website.
****SOLUTION****
If I do it like this:
<p><i class="fa fa-camera-retro"> </i> some text</p>
Everything works as I want.
Still, all the older font-awesome css from the website is missing from the content blocks, but it is rendering when I view the website in a browser. If anyone has a suggestion how that can be fixed?
Ahh, I think I see your problem. You entered a new HTMLblock, and just pasted in the fa-camera-retro. FontAwesome works as a class and should be entered within a tag.
You can use the <i> tag for it, but also the <p> tag or whatever you want. It should be then something like
<i class="fa fa-camera-retro"></i> (dont forget the extra fa class to make it appear as a font awesome.
It's also worth remembering for the future that when you use the content block, TINYMCE automatically strips out some HTML tags by default, this includes <i>'s... To prevent TINYMCE from doing this, go to:
Dashboard > System & Settings > BASICS / Rich Text Editor. Once there, select 'Custom' and add the following line
verify_html: false
For more information, it's worth keeping this in your bookmarks when using Concret5, especially the content block: http://www.tinymce.com/wiki.php/Configuration3x:verify_html
I saw this on your page:
It should be <p><i class="fa fa-camera-retro"></i> some text</p>
Result:
So basically what you need to so is just change this
<p>fa-camera-retro</p>
to this
<p><i class="fa fa-camera-retro"></i> some text</p>
The trick to adding FontAwesome icons in C5 Content blocks is using the em tag along with adding code for non-breaking space between them.
<em class="fa fa-camera-retro"> </em>
Check if you have given your icon any sort of margin, I had the same problem where some icons would make when I checked keenly I noticed I had a CSS rule.
p i{
margin-left:10px;
}
when I removed that margin all my icons worked.