How to Add Social Media Icons in HTML and CSS?
Social Media Icon Using Html And Css
Code by | N/A |
Project Download | Link Available Below |
Language used | HTML and CSS |
External link / Dependencies | Yes |
Responsive | Yes |
HTML And Css CODE For Social Media Icon:-
To insert an icon, add the name of the icon class to any inline HTML element.
The <i>
and <span>
elements are widely used to add icons.
All the icons in the icon libraries below are scalable vector icons that can be customized with CSS (size, color, shadow, etc.)
NOTE:-Besides from FontAwesome You can use several other websites for inserting icons likeĀ Ionicons,Ā Bootstrap3, Google icons, etc.
For inserting the styling into HTML.
CSS can be added to HTML documents in 3 ways:
- Inline – by using the
style
attribute inside HTML elements - Internal – by using a
<style>
element in the<head>
section - External – by using a
<link>
element to link to an external CSS file
The most common way to add CSS is to keep the styles in external CSS files. However, in this tutorial, we will use inline and internal styles, because this is easier to demonstrate and easier for you to try it yourself.
Gym Website Using HTML and CSS With Source Code
Inline CSS
Inline CSS is used to apply a unique style to a single HTML element.
An inline CSS uses the style
attribute of an HTML element.
Internal CSS
Internal CSS is used to define a style for a single HTML page.
Internal CSS is defined in the <head>
section of an HTML page, within a <style>
element.
Restaurant Website Using HTML and CSS
External CSS
An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the <head>
section of each HTML page:
In this code, we are using Internal CSS for basic styling like color, size, etc.
We are going to use only some basics of HTML like anchor tag unordered list, list tag, div tag, etc.
<!Doctype Html> <Html> <Head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <Title> icons of social media 2020 </Title> <style> .fa { padding: 20px; text-align: center; margin: 5px 2px; font-size: 30px; width: 50px; } .fa-facebook { background: #3B5998; color: white; } .fa-twitter { background: #55ACEE; color: white; } .fa-pinterest { background: #cb2027; color: white; } .fa-linkedin { background: #007bb5; color: white; } .fa-instagram { background: #125688; color: white; } .fa-youtube { background: #bb0000; color: white; } .fa-google { background: #dd4b39; color: white; } .fa-snapchat-ghost { background: #fffc00; color: white; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; } .fa-skype { background: #00aff0; color: white; } .fa:hover { opacity: 0.9; } ul li { list-style: none; } </style> </Head> <Body> <ul> <li><a href="#" class="fa fa-facebook"> </a> </li> <li> <a href="#" class="fa fa-twitter"> </a> </li> <li><a href="#" class="fa fa-pinterest"> </a> </li> <li> <a href="#" class="fa fa-linkedin"> </a> </li> <li> <a href="#" class="fa fa-instagram"> </a> </li> <li> <a href="#" class="fa fa-youtube"> </a> </li> <li><a href="#" class="fa fa-google"> </a> </li> <li> <a href="#" class="fa fa-snapchat-ghost"> </a> </li> <li> <a href="#" class="fa fa-skype"> </a></li> </ul> </Body> </Html>
100+ JavaScript Projects With Source Code ( Beginners to Advanced)
this is Html and Css Code Together in the file. we use font-awesome icon CDN link for showing social media icon.
Html And Css Code Output Of Social Media Icon:-
Which code editor do you use for this Social Media Icon coding?
I personally recommend using VS Code Studio, it’s straightforward and easy to use.
is this project responsive or not?
Yes! this is a responsive project
ADVERTISEMENT
Do you use any external links to create this project?
yes!
ADVERTISEMENT