I wanted to add a certain font awesome icon (fa-arrow-alt-circle-down), but it's not showing. I copied the classes from the website and entered them in my HTML. I tried other icons before and there was no issue with them. Sometimes I change .far to .fa, but now that doesn't work either. Can someone see why?
<div class="jumbotron jumbotron-fluid">
<h1 class="heading-primary heading-primary--main"> Wizard's unite fans</h1>
<div class="navigation-container">
<button class="find-locals-nav-btn">Find Local players</button>
<button class="forum-nav-btn">Forum</button>
<button>login / register</button>
</div>
<i class="far fa-arrow-alt-circle-down"></i>
</div>
SCSS file
.jumbotron {
height: 100vh;
background-image: linear-gradient(
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)
), url("https://i.amz.mshcdn.com/-7R3bLC1xTVhrjc86pBeYAogXFY=/950x534/filters:quality(90)/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fcard%2Fimage%2F760683%2F2117d274-d2cf-46b9-b60c-698d65361438.jpg");
background-size: cover;
position: relative;
padding: 5rem;
margin-bottom: 2rem;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 85vh, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
.heading-primary {
opacity: .8;
}
#include respond(phone) {
-webkit-clip-path: polygon(0 0, 100% 0, 100% 90vh, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 90vh, 0 100%);
background-position: center top;
}
.navigation-container {
border-radius: 20px;
background-color: #fff;
font-size: 2rem;
width: 70%;
margin: 4rem auto 0 auto;
display: flex;
text-align: center;
justify-content: center;
padding: 1rem;
background-image: linear-gradient(to bottom right, #ccc, #666);
> * {
background-color: transparent;
border: none;
flex: 1 0 0;
cursor: pointer;
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
&:hover {
transform: translateY(-.2rem);
}
&:not(:last-child) {
border-right: 1px solid #444;
}
}
}
.fa-arrow-alt-circle-down {
font-size: 4rem;
color: #fff;
}
}
.fa Font Awesome are v4. .far are v5.
For all icons existing in both, changing far to fa will do the trick. For the ones added in v5, obviously, it won't, as they do not exist in v4.
You can view all v4.7 icons here.
For future notice, finding version specific FA icons is by searching for "font awesome x.x cheatsheet". Replace x.x with the proper version.
Related
Expected
.clipped-button {
height: 42px;
min-width:120px;
width: auto;
display: block;
border:none;
border-radius:2px;
align-items:center;
clip-path: polygon(0px 0%, 0px 60%, 18px 100%, 100% 100%, 100% 40%, calc(100% - 18px) 0px);
padding: 2.625px;
background-color: #993029;
}
.btn {
width: 100%;
height: 100%;
background-color: rgb(205, 65, 58);
display:flex;
justify-content:center;
align-items:center;
clip-path: polygon(0px 0%, 0px 60%, 16px 100%, 100% 100%, 100% 40%, calc(100% - 16px) 0px);
color: rgb(255, 255, 255);
}
<button class="clipped-button"><div class="btn">Click Me</div>
</button>
Not getting the clipped corners rounded
Please help to round the clipped corners at top right and bottom left if possible
Rather than a clip-path perhaps something similar to the following is an option.
.button {
display: inline-block;
width: 200px;
height: 50px;
padding: 10px 20px;
font-size: 1.2em;
cursor: pointer;
text-align: center;
text-decoration: none;
justify-content: center;
align-items: center;
outline: none;
color: #fff;
border-radius: 25px;
border: 5px solid rgb(190, 40, 40);
background-color: rgba(200, 60, 60, 0.6);
background-image: linear-gradient(to bottom right, rgba(255,0,0,0), rgba(200, 60, 60, 0.8));
}
.button:hover {
box-shadow: 0 10px 10px 0 rgba(0,0,0,0.2);
/*--background-color: rgba(200, 60, 60, 1.0); --alt color--*/
background-image: linear-gradient(to bottom right, rgba(255,0,0,0), rgba(250, 100, 100, 1.0));
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\1F846 \1F846';
position: absolute;
opacity: 0;
top: -2px;
right: -40px;
transition: 0.5s;
}
.button:hover span {
padding-right: 40px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
<button class="button"><span> Click Me </span></button>
i was wondering if I can change the "fa fa-cube" so the background is not transparent. I want to use it on top of a playingcard-background and as you can see below, it doesn't look that great like this...
The best would be a white or light-blue fill.
Maybe i can put another cube behind it? But i am really a beginner.
.deck {
border: 2px dashed #080808;
width: 160px;
height: 120px;
}
.deck .card {
justify-content: space-around;
font-size: 50px;
color: #0023F5;
display: flex;
flex-direction: column;
position: relative;
text-align: center;
transform-origin: center;
border-radius: 15px;
border: 5px solid black;
height: 116px;
background-color: #e5e5f7;
opacity: 0.8;
background-image: linear-gradient(135deg, #F74141 25%, transparent 25%), linear-gradient(225deg, #F74141 25%, transparent 25%), linear-gradient(45deg, #F74141 25%, transparent 25%), linear-gradient(315deg, #F74141 25%, #e5e5f7 25%);
background-position: 10px 0, 10px 0, 0 0, 0 0;
background-size: 10px 10px;
background-repeat: repeat;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="deck">
<div class="card">
<i class="drawing fa fa-cube"></i>
</div>
</div>
PS: i tried aria-hidden="true" but didn't really know what this does.
Probably not the most elegant solution but it works. Basically, I layered in copies of the icon (as filler) and used a couple of different clip-paths to render the white background where the transparent parts are, then put everything in a container and used z-index to push the white parts behind the actual blue icon so the background fillers wouldn't overlap the actual blue icon. You can use the container for positioning etc.
.deck {
border: 2px dashed #080808;
width: 160px;
height: 120px;
}
.deck .card {
justify-content: space-around;
font-size: 50px;
color: #0023F5;
display: flex;
flex-direction: column;
position: relative;
text-align: center;
transform-origin: center;
border-radius: 15px;
border: 5px solid black;
height: 116px;
background-color: #e5e5f7;
opacity: 0.8;
background-image: linear-gradient(135deg, #F74141 25%, transparent 25%), linear-gradient(225deg, #F74141 25%, transparent 25%), linear-gradient(45deg, #F74141 25%, transparent 25%), linear-gradient(315deg, #F74141 25%, #e5e5f7 25%);
background-position: 10px 0, 10px 0, 0 0, 0 0;
background-size: 10px 10px;
background-repeat: repeat;
}
.faContainer {
display: flex;
flex-direction: column;
padding: 0;
margin: 0 auto;
position: relative;
}
.fa-cube {
z-index: 1;
}
.fa-cubeBGTop {
position: absolute;
z-index: 0;
background-color: white;
clip-path: polygon(7% 28%, 47% 14%, 86% 29%, 46% 44%);
}
.fa-cubeBGSide {
position: absolute;
z-index: 0;
background-color: white;
clip-path: polygon(43% 50%, 85% 30%, 90% 78%, 38% 95%);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="deck">
<div class="card">
<div class="faContainer">
<i class="drawing fa fa-cube"></i>
<i class="fa fa-cube fa-cubeBGTop"></i>
<i class="fa fa-cube fa-cubeBGSide"></i>
</div>
</div>
</div>
I wonder how I can place the section class="teacher__section on the right side of the screen using flexbox. Not by float. I have written "justify-content: flex-end;", width 80% also 100% but it doesnt seem to be placing on right side.
I mean I have on the picture below succeeded placing the section on the right side, but the problem now is the left side where I want to get rid of the extra white box and the extra box-shadow. I want it to go around the image just like in
<section class="explore__section"> where I have the box-shadow go around the image. Source code is under below the image.
Source code:
.explore__container {
margin: 5% 0 2% 0;
display: flex;
width: 80%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 0rem 2rem 2rem 0;
}
.forkids__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(0 0, 75% 0, 100% 100%, 0 100%);
margin-right: -20%;
}
.forkids__img {
background-image: url(/img/kids-science.jpeg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0%, 100% 100%, 25% 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 0rem 2rem 2rem 0;
}
.teacher__section {
display: flex;
justify-content: flex-end;
width: 100%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 0rem 2rem 2rem 0;
}
.teacher__container {
display: flex;
justify-content: flex-end;
width: 100%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 2rem 0 0 2rem;
}
.teacher__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
margin-left: -20%;
text-align: right;
font-size: 2rem;
}
.teacher__img {
background-image: url(/img/teacher-science.jpg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 2rem 0 0 2rem;
}
<section class="explore__section">
<div class="explore__container">
<div class="forkids__info"> some text</div>
<div class="forkids__img"></div>
</div>
</section>
<section class="teacher__section">
<div class="teacher__container">
<div class="teacher__img"></div>
<div class="teacher__info">some text</div>
</div>
</section>
Try this solution, Hope this will help
<section class="explore__section">
<div class="explore__container">
<div class="forkids__info"> some text</div>
<div class="forkids__img"></div>
</div>
</section>
<section class="teacher__section">
<div class="teacher__container">
<div class="teacher__img"></div>
<div class="teacher__info">some text</div>
</div>
</section>
<style>
.explore__container {
margin: 5% 0 2% 0;
display: flex;
width: 80%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 0rem 2rem 2rem 0;
}
.forkids__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(0 0, 75% 0, 100% 100%, 0 100%);
margin-right: -20%;
}
.forkids__img {
background-image: url(/img/kids-science.jpeg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0%, 100% 100%, 25% 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 0rem 2rem 2rem 0;
}
.teacher__section {
display: flex;
justify-content: flex-end;
width: 100%;
height: 10rem;
border-radius: 0rem 2rem 2rem 0;
}
.teacher__container {
display: flex;
justify-content: flex-end;
width: 80%;
height: 10rem;
box-shadow: 1rem 1rem 1rem 1rem rgb(0, 0, 0, 0.2);
border-radius: 2rem 0 0 2rem;
}
.teacher__info {
flex-basis: 70%;
height: 100%;
background-color: bisque;
clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
margin-left: -20%;
text-align: right;
font-size: 2rem;
}
.teacher__img {
background-image: url(/img/teacher-science.jpg);
flex-basis: 50%;
height: 100%;
clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 2rem 0 0 2rem;
}
</style>
I'm trying to display 2 images in a line below a line of text, but they show up in the same line. I tried using the "clear: both" property and "display: block" property in the CSS style for the images. What am I missing?
I included a screenshot of what it looks like as well as the relevant section of the HTML code and the complete CSS stylesheet. The "media" class is what I am using for the images. They are showing on the same line as the section under the "Contacts" div.
screenshot of website here
body {
background-color: #63a4ff;
background-image: linear-gradient(315deg, #63a4ff 0%, #83eaf1 74%);
}
.fadeline {
background-color: white;
margin: 25px 20%;
width: 60%;
height: 1px;
}
.fadeline.white {
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
}
.fadeline.black {
background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.row {
background-color: white;
margin: 0% 15% 0% 15%;
padding-bottom: 15%;
padding-top: 50px;
color: #586E95;
}
.header {
text-align: center;
padding-left: 40%;
}
#about {
text-align: center;
}
p {
margin: 0 auto;
display: block;
clear: both;
}
.example {
margin: 0 auto;
background-color: white;
border: 1px solid black;
border-radius: 10%;
outline: none;
width: 20%;
}
a,
a:hover {
text-decoration: none;
display: block;
}
img {
max-height: 90%;
max-width: 90%;
}
.media {
height: 55px;
width: 55px;
display: block;
margin: 0 auto;
}
<div id="contact" class="row text-center">
<h1 class="header">Contact</h1>
<div class="fadeline black"></div>
<p> Want to connect? Reach out with Facebook or LinkedIn.</p>
<div class='media'>
<a href='https://www.facebook.com/siddharth.gampa/'><img src='https://facebookbrand.com/wp-content/uploads/2019/04/f_logo_RGB-Hex-Blue_512.png?w=512&h=512'></a>
</div>
<div class='media'>
<a href='https://www.linkedin.com/in/siddharth-gampa/'><img src='https://image.flaticon.com/icons/svg/174/174857.svg'></a>
</div>
</div>
If you place both images in one div with the class .media then set that div to display: flex that should work.
Check out the example code below by clicking the Run code snippet
body {
background-color: #63a4ff;
background-image: linear-gradient(315deg, #63a4ff 0%, #83eaf1 74%);
}
.row {
display: flex;
flex-direction: column;
background-color: white;
margin: 0 15%;
padding: 50px 0;
color: #586E95;
}
.text-center {
text-align: center;
}
.heading {
text-align: center;
}
.fadeline {
background-color: white;
margin: 25px 20%;
width: 60%;
height: 1px;
}
.fadeline.white {
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
}
.fadeline.black {
background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.media {
display: flex;
justify-content: center;
width: 100%;
}
a img {
width: 40px;
margin: 0 10px;
}
<div id="contact" class="row text-center">
<h1 class="heading">Contact</h1>
<div class="fadeline black"></div>
<p> Want to connect? Reach out with Facebook or LinkedIn.</p>
<div class='media'>
<a href='https://www.facebook.com/siddharth.gampa/'>
<img src='https://facebookbrand.com/wp-content/uploads/2019/04/f_logo_RGB-Hex-Blue_512.png?w=512&h=512'>
</a>
<a href='https://www.linkedin.com/in/siddharth-gampa/'>
<img src='https://image.flaticon.com/icons/svg/174/174857.svg'>
</a>
</div>
</div>
It looks like they're not below the text because they're in the same div with the row class.
Put them in a div below the row and it should work
Add a class to both images. For example
Class="img-1"
And
Class="img-2"
Make their position relative then push one of the images to the right. It may take some fiddling to get the locations correct
I am struggling with this overlay. On the prod site the :before element overlays a div with a full image bg. When viewing the site in Chrome and Firefox the content is displayed above the overlay as intended. However, when viewing the content in IE11 the :before element overlays everything in that parent div.
I would like the result in Chrome to be the same in IE.
Ex. Overlay above image, text/content on top of the overlay.
See: JSFiddle
.foreverCTA:before {
content: "";
width: 100%;
height: 900px;
background: #2f71a9;
background: -webkit-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -o-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -moz-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: radial-gradient(circle, transparent -25%, #2f71a9 81%);
position: absolute;
left: 0;
}
.foreverCTA {
color: #fff;
/*display: flex;*/
background: #fff url("images/2015APR06_RAYSBASEBALL_MFPB6240s.jpg") no-repeat center;
background-size: cover;
height: 900px;
/*justify-content: center;
flex-wrap: wrap;
align-items: center;*/
}
.foreverCTA p,
.foreverCTA h2,
.foreverCTA h4 {
color: #fff!important;
}
.foreverCTA li,
.foreverCTA ul {
list-style: none;
padding: 0;
}
.foreverCTA p,
.foreverCTA h3,
.foreverCTA h2,
.foreverCTA li {
-webkit-filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, .4));
filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, .4));
}
.ion-ios-baseball {
margin: 3px;
padding-top: 10px;
font-size: 2em;
vertical-align: center;
}
.foreverGame {
margin-top: 50px;
}
.foreverHeader {
padding-top: 50px;
/*-webkit-flex: 1 1 100%;
-moz-flex: 1 1 100%;
-ms-flex: 1 1 100%;
-o-flex: 1 1 100%;
flex: 1 1 100%;
z-index: 999;*/
}
.waysToBuy {
margin: 50px 0;
}
.buyDetails {
min-height: 210px;
text-align: center;
}
.foreverHeader h1,
.waysToBuy h1 {
font-size: 4.5em;
color: #ECDC00!important;
padding: 0!important;
margin: 0;
-webkit-filter: drop-shadow(2px 4px 0px rgba(249, 159, 28, 1));
filter: drop-shadow(2px 4px 0px rgba(249, 159, 28, 1));
}
.foreverHeader h3 {
font-size: 3.5em;
color: #fff!important;
margin: 5px;
}
.foreverBuy {
/*display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: flex-start;*/
}
.buy1,
.buy2 {
height: 400px;
/*display: flex;
flex-direction: column;
justify-content: center;
flex-wrap: wrap;
align-items: flex-end;
flex-basis: 20%;*/
}
.buyDetails {
/*align-self: flex-start;*/
}
.buyButton {
/*flex-basis: 50%;
align-self: center;*/
vertical-align: bottom;
}
.buy2 a {
color: #ECDC00!important;
}
<div class="foreverCTA">
<div class="row">
<div class="foreverHeader">
<h3>Lorem ipsum<br></h3>
<h1>Lorem ipsum<br></h1>
<h3>Lorem ipsum</h3>
</div>
</div>
<div class="row">
<div class="foreverGame">
<h2>Lorem ipsum</h2>
</div>
<div class="foreverDate">
<h3>Lorem ipsum</h3>
</div>
</div>
</div>
This will do the trick,
check this fiddle here
first remove position:absolute property and add following properties as,
display:block;
margin-bottom:-900px;
so your final CSS will be as follows,
.foreverCTA:before {
content: "";
width: 100%;
height: 900px;
background: #2f71a9;
background: -webkit-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -o-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: -moz-radial-gradient(circle, transparent -25%, #2f71a9 81%);
background: radial-gradient(circle, transparent -25%, #2f71a9 81%);
left: 0;
display:block;
margin-bottom:-900px;
}