I am trying to position the icons to the right and the tags to the center.
My website is using BootStrap and Font-Awesome. Below is the HTML:
<div class="row">
<div class="col-lg-12" style="text-align: center">
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Health</span>
</a>
<span> </span>
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Fitness</span>
</a>
<span> </span>
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Safety</span>
</a>
<span> </span>
<i class="fa fa-heart faa-pulse animated" style="float:right;"></i>
<i class="fa fa-star faa-pulse animated" style="float:right;"></i>
<i class="fa fa-smile-o faa-pulse animated" style="float:right;"></i>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1 class="post-header" style="text-align: center">This is the header</h1>
</div>
</div>
CSS:
#keyframes pulse {
0% {
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
50% {
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
100% {
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
}
.faa-pulse.animated,
.faa-pulse.animated-hover:hover,
.faa-parent.animated-hover:hover > .faa-pulse {
-webkit-animation: pulse 2s linear infinite !important;
animation: pulse 2s linear infinite !important;
font-size:1.8em;
}
.fa-heart {
color: red !important;
}
.fa-star {
color: gold !important;
}
.fa-smile-o {
color: deeppink !important;
}
The problem is my icons are overlapping with each other during animation and the tags are not aligned to the center. Also,there is very little space between the icons. How can I solve this problem?
Here is the demo
Try this:
Re-formated HTML:
<div class="row">
<div class="col-lg-12 text-center">
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Health</span>
</a>
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Fitness</span>
</a>
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Safety</span>
</a>
<span class="animated-icons">
<i class="fa fa-heart faa-pulse animated"></i>
<i class="fa fa-star faa-pulse animated" ></i>
<i class="fa fa-smile-o faa-pulse animated" ></i>
</span>
</div>
</div>
CSS:
.animated-icons {
position: absolute;
right: 15px;
}
There are 2 ways to do this,
from user guide example http://fontawesome.io/examples/
Use fa-fw to set icons at a fixed width. Great to use when different icon widths throw off alignment. Especially useful in things like nav lists & list groups.
<div class="row">
<!-- edited (1) -->
<div class="col-lg-12" style="text-align: center;position: relative;">
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Health</span>
</a>
<span> </span>
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Fitness</span>
</a>
<span> </span>
<a href="#" style="text-decoration: none;">
<span style="background-color: #171717; color: #FFF; padding: 2px">Safety</span>
</a>
<!-- edited (2) -->
<div style="position: absolute;top: 0;right: 0;">
<i class="fa fa-fw fa-heart faa-pulse animated" ></i>
<i class="fa fa-fw fa-star faa-pulse animated" ></i>
<i class="fa fa-fw fa-smile-o faa-pulse animated" ></i>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1 class="post-header" style="text-align: center">This is the header</h1>
</div>
</div>
or u could change css
.faa-pulse{
margin:3px;
}
see this https://jsfiddle.net/jayakrishnancn/73Lfxnpg/3/
Try Adding margin to the font Awesome Icons
i.fa
{
margin:4px;
}
Hope this helps.. :D
Related
In bulma navbar I have a logo on the left and one dropdown menu on the right. I want to make the menu always visible and only open on hover. Right now when the screen size in smaller than 1088px, the dropdown menu opens automatically on the right.
<nav class="navbar">
<div class="container">
<div class="navbar-brand is-expanded">
<a class="navbar-item" href="#">
<img src="img.png" width="131" height="35">
</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Docs
</a>
<div class="navbar-dropdown">
<a class="navbar-item">
Overview
</a>
<a class="navbar-item">
Elements
</a>
<a class="navbar-item">
Components
</a>
<hr class="navbar-divider">
<div class="navbar-item">
Version 0.7.1
</div>
</div>
</div>
</div>
</div>
</nav>
maybe this will help you
.navbar-dropdown {
background-color: white;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border-top: 2px solid #dbdbdb;
box-shadow: 0 8px 8px rgba(10, 10, 10, 0.1);
display: none;
font-size: 0.875rem;
left: 0;
min-width: 100%;
position: absolute;
top: 100%;
z-index: 20;
}
.navbar-item:hover .navbar-dropdown{
display: block;
}
#media screen and (max-width: 1088px){
.navbar-dropdown{
display: none;
}
}
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.css" media="all" />
<nav class="navbar">
<div class="container">
<div class="navbar-brand is-expanded">
<a class="navbar-item" href="#">
<img src="img.png" width="131" height="35">
</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Docs
</a>
<div class="navbar-dropdown">
<a class="navbar-item">
Overview
</a>
<a class="navbar-item">
Elements
</a>
<a class="navbar-item">
Components
</a>
<hr class="navbar-divider">
<div class="navbar-item">
Version 0.7.1
</div>
</div>
</div>
</div>
</div>
</nav>
im working on a portfolio website and i have a bug on my code, i want to put footer under card pricing. thank you.
https://i.stack.imgur.com/qYMvd.jpg
HTML :
FOOTER SECTION :
<footer class="footerP">
<div class="container-fluid">
<div class="row">
<div class="small-footer col-12 col-lg-12">
<div class="footer-title col-12 col-lg-6">
<h3>PASTEUR SERVICE STATION</h3>
</div>
<div class="footer-social hidden-md-down col-lg-6 text-right">
<ul id="menu">
<li>
<a href="#">
<i class="fab fa-facebook"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-twitter"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-google-plus-g"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-instagram"></i>
</a>
</li>
</ul>
</div>
</div>
<div class="big-footer">
</div>
</div>
</div>
</footer>
CSS CARD :
.card{
max-width: 300px;
height: auto;
border-radius: 15px;
padding: 40px 20px;
margin: 0 auto;
box-shadow: 0 10px 15px rgba(0, 0, 0, .4);
transition: .5s;
overflow: hidden;
}
FOOTER CSS :
.footerP .small-footer{
width: 100%;
height: 40px;
background: #232323;
}
thank you guys for help.
Wrap the whole thing in a footer tag and assign a class of "footer" (the Bootstrap default class).
<footer class="footer">
<div class="container-fluid">
<!--Rest of your code --!>
The default Bootstrap .footer will keep it full width and sticky to the bottom of the page.
Here is my footer image with social icons. I need to know how to add that using bootstrap/css??
As like the picture shown. I need to know how to add that using bootstrap or css? How to design that separation? This is my code for the footer.
<footer class="footer">
<div class="container text-left">
<small style="color:grey" class="copyright">Copyright © 2015 SVAPP Private Limited.All Rights Reserved.</small>
<small style="color:grey" class="fa fa-lg fa-skype pull-right"> </small>
<small style="color:grey" class="fa fa-lg fa-google-plus pull-right"> </small>
<small style="color:grey" class="fa fa-lg fa-linkedin pull-right"> </small>
<small style="color:grey" class="fa fa-lg fa-twitter pull-right"> </small>
<small style="color:grey" class="fa fa-lg fa-facebook pull-right"> </small>
</div><!--End container-->
</footer><!--End footer 2-->
Image here
Here is one solution how you can create this using Bootstrap and Font awesome icons. Bootstrap glyphicons don't have social icons so you can include some other icons font.
.footer {
background: #061D25;
padding: 10px 0;
}
.footer a {
color: #70726F;
font-size: 20px;
padding: 10px;
border-right: 1px solid #70726F;
transition: all .5s ease;
}
.footer a:first-child {
border-left: 1px solid #70726F;
}
.footer a:hover {
color: white;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<footer class="footer">
<div class="container text-center">
<i class="fa fa-facebook"></i>
<i class="fa fa-twitter"></i>
<i class="fa fa-linkedin"></i>
<i class="fa fa-google-plus"></i>
<i class="fa fa-skype"></i>
</div>
</footer>
You can also create this without Bootstrap framework and css will be almost the same, you just need to include icons font.
footer {
background: #061D25;
padding: 10px 0;
text-align: center;
}
footer a {
color: #70726F;
font-size: 20px;
padding: 10px;
border-right: 1px solid #70726F;
transition: all .5s ease;
}
footer a:first-child {
border-left: 1px solid #70726F;
}
footer a:hover {
color: white;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet"/>
<footer>
<i class="fa fa-facebook"></i>
<i class="fa fa-twitter"></i>
<i class="fa fa-linkedin"></i>
<i class="fa fa-google-plus"></i>
<i class="fa fa-skype"></i>
</footer>
look in http://lipis.github.io/bootstrap-social/ where you can get the icons for boostrap.
UPDATE 2:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.10.1/bootstrap-social.css" rel="stylesheet" >
<body>
<div class="text-center">
<a onclick="" class="btn btn-social-icon btn-lg btn-facebook"><i class="fa fa-facebook"></i></a>
<a onclick="" class="btn btn-social-icon btn-lg btn-dropbox"><i class="fa fa-dropbox"></i></a>
<a onclick="" class="btn btn-social-icon btn-lg btn-flickr"><i class="fa fa-flickr"></i></a>
<a onclick="" class="btn btn-social-icon btn-lg btn-pinterest"><i class="fa fa-pinterest"></i></a>
</div>
</body>
</html>
Hi guys so I'm working on a website with an orange background. I'm using white social icons from the Font Awesome library.
Here is the result of my work
CSS
#import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
#import url('http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font- awesome.min.css');
body {
margin: 10px;
background:#da4a10;
}
#social:hover {
-webkit-transform:scale(1.1);
-moz-transform:scale(1.1);
-o-transform:scale(1.1);
}
#social {
-webkit-transform:scale(0.8);
/* Browser Variations: */
-moz-transform:scale(0.8);
-o-transform:scale(0.8);
-webkit-transition-duration: 0.5s;
-moz-transition-duration: 0.5s;
-o-transition-duration: 0.5s;
}
.fa-3x{
color: white;
}
.social-fb:hover {
color: #3B5998;
}
.social-tw:hover {
color: #4099FF;
}
.social-gp:hover {
color: #d34836;
}
.social-em:hover {
color: #f39c12;
}
HTML
<div id="row">
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6">
<a href="#">
<i id="social" class="fa fa-facebook-square fa-3x social-fb"></i>
</a>
</div>
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6">
<a href="#">
<i id="social" class="fa fa-twitter-square fa-3x social-tw"></i>
</a>
</div>
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6">
<a href="#">
<i id="social" class="fa fa-google-plus-square fa-3x social-gp"></i>
</a>
</div>
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6 ">
<a href="#">
<i id="social" class="fa fa-envelope-square fa-3x social-em"></i>
</a>
</div>
</div>
http://jsfiddle.net/DTcHh/5582/
I need a solution because when I hover over the social icons, the look of it is not so nice. I tried adding a white background to the icons but it's still not functioning properly.
Since you are using Font Awesome, there is an icon available called: fa-square. This has the exact shape of the square social media icons. Also, Font Awesome has the opportunity to stack icons. If you stack a fa-square under a fa-twitter-square e.g. and make fa-square white, it will solve your problem.
HTML
<div id="row">
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6">
<a href="#">
<span class="fa-stack fa-2x social social-fb">
<i class="fa fa-square fa-stack-1x white-bg"></i>
<i class="fa fa-facebook-square fa-stack-2x "></i>
</span>
</a>
</div>
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6">
<a href="#">
<span class="fa-stack fa-2x social social-tw">
<i class="fa fa-square fa-stack-1x white-bg"></i>
<i class="fa fa-twitter-square fa-stack-2x "></i>
</span>
</a>
</div>
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6">
<a href="#">
<span class="fa-stack fa-2x social social-gp">
<i class="fa fa-square fa-stack-1x white-bg"></i>
<i class="fa fa-google-plus-square fa-stack-2x "></i>
</span>
</a>
</div>
<div class="col-xs-2 col-sm-8 col-lg-2 col-md-6 ">
<a href="#">
<span class="fa-stack fa-2x social social-em">
<i class="fa fa-square fa-stack-1x white-bg"></i>
<i class="fa fa-envelope-square fa-stack-2x "></i>
</span>
</a>
</div>
</div>
CSS
/* Optional theme */
#import url('http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
#import url('http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
body {
background: #DA4A10;
margin: 10px;
}
.social {
color: #F9F9F9;
transition: 0.5s;
-moz-transition: 0.5s;
-ms-transition: 0.5s;
-o-transition: 0.5s;
-webkit-transition: 0.5s;
}
/* Definition of the white background */
.white-bg {
color: white;
font-size: 54px;
opacity: 0;
transition: 0.5s;
-moz-transition: 0.5s;
-ms-transition: 0.5s;
-o-transition: 0.5s;
-webkit-transition: 0.5s;
}
.social-fb:hover{
color: #3B5998;
}
.social-tw:hover {
color: #4099FF;
}
.social-gp:hover {
color: #d34836;
}
.social-em:hover {
color: #f39c12;
}
/* Show the white background on hover */
.social-fb:hover .white-bg, .social-tw:hover .white-bg,
.social-gp:hover .white-bg, .social-em:hover .white-bg {
opacity: 1;
}
Solution in action: http://jsfiddle.net/DTcHh/6084/
I have a aside which is of 260px width. when i try to place my user-icon and name info, there is too much of right-margin.
<div class="rightBox pull-right" href="#">
<ul class="navbar-nav navbar-right">
<li class="dropdown">
<li style="margin-top: 3px">
<i class="fa fa-2x fa-border fa-user"></i>
</li>
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<label class="navbar-text" style="margin-top: 5px;margin-left:0;">
<strong><h4>
<span>Karl Cadigan</span>
<b class="glyphicon glyphicon-chevron-down"></b>
</h4></strong>
</label>
</a>
</ul>
</div>
Below is my fiddle. I want to bring the user-icon and the user-name to left leaving the drop-down icon at right.
http://jsbin.com/kugudaho/6/edit
Add the following class in your CSS. Use display:inline-block to show the info next to each other.
ul.navbar-nav
{
position:relative;
}
ul.navbar-nav li {
list-style: none;
display:inline-block;
}
.glyphicon{position:absolute; right:15px; top:15px;}
DEMO
If I understand it right this is what you need
HTML Markup
<div class="rightBox" href="#">
<ul class="navbar-nav">
<li class="dropdown">
<li style="margin-top: 3px">
<i class="fa fa-2x fa-border fa-user"></i>
</li>
<li class="glyph">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<label class="navbar-text" style="margin-top: 5px;margin-left:0;">
<strong><h4>
<span>Frank</span>
<b class="glyphicon glyphicon-chevron-down"></b>
</h4></strong>
</label>
</a>
</ul>
</div>
CSS
i {
list-style: none;
}
.rightBox{ height: 60px; width:260px; border:1px dashed red; }
.fa-user {
position: relative;
background: #666666;
}
.fa-user:after {
content: '';
position: absolute;
top: 0;
right: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 0 15px 15px 0;
border-color: transparent #89cd17 transparent transparent;
}
.navbar-nav li.glyph {
float: right !important;
}
.navbar-nav {
float: inherit;
padding-left: 10px;
}
I hope I understood what you need.
I think you're better off starting with a standard Bootstrap dropdown, and customizing where needed. Uses a lot less custom CSS (if any) and is easier to maintain...
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-2x fa-border fa-user"></i> <!-- put this inside the a element to bind it to the text -->
Frank
<span class="glyphicon glyphicon-chevron-down"></span> <!-- bootstrap used the class "caret" to designate a dropdown, but you can change it with a glyphicon if you need to -->
</a>
<ul class="dropdown-menu">
<li>Choice1</li>
<li>Choice2</li>
<li>Choice3</li>
</ul>
</div>
Example:http://www.bootply.com/f9WYqJqLmd