How can I add a gradient inside this triangle [duplicate] - html

This question already has answers here:
Make CSS3 triangle with linear gradient
(5 answers)
Closed 1 year ago.
I am trying to create a website but am having a little trouble adding a gradient into triangle shape I have created in css.
Here is what I am trying to go for:
Figma Prototype
However here is what I have right now
Actual Website
.triangle-tl {
width: 0;
height: 0;
border-top: 1000px solid black;
border-right: 2000px solid transparent;
}
<div class="triangle-tl"></div>
What Can I do to add a gradient into this triangle?

You can use the clip-path CSS property to do that.
to get a basic understanding click here.
And if you want to go for a specific clip-path design (geometry).
yu can easily make it with This.

Related

inverting the css to divide it into wo parts [duplicate]

This question already has answers here:
Is it possible to have two background colors for a single html element? [duplicate]
(3 answers)
Closed 2 years ago.
i have a div as follows
https://prnt.sc/w84dzj
div.button.fill {
color: #FFFFFF;
background-color: #ffcc00;
}
I'd like to color, not the whole, but only half the circle in a given color, and the other half in another color (maybe by using two classes called leftHalf and rightHalf).
the code i am trying is, if the leftside half is white, the inside image should be half blue so the user should know that they have completed half profile and when they are done with profile, it will display just like the above image
You can do that by using background-image: linear-gradient(...) like this.
div {
color: #FFFFFF;
background-image: linear-gradient(90deg,red 50%,yellow 50%);
height: 100px;
width: 100px;
border-radius: 50px;
}
<div></div>
Also if you don't set a presentage after
each color they will have a smooth transition.
You can also add in as many colors as you want.

How to create a horizontal dashed arrow for Squarespace [duplicate]

This question already has answers here:
How to animate a dashed arrow?
(2 answers)
Closed 2 years ago.
I'm just needing some HTML and CSS to create a normal dashed arrow in Squarespace.
I would like to customise the colour to #034472 and have similar style to the pic, pointing right, if possible.
Any help with this would be much appreciated!
span {
content: "\21E0";
font-size: 100px;
color: #034472;
}
<span style="color: #034472; font-size: 100px;">⇠</span>

CSS stroke on half of web font [duplicate]

This question already has answers here:
Is it possible to apply CSS to half of a character?
(20 answers)
Closed 3 years ago.
CSS stroke allows to outline a font.
I want to outline only 50% of a font.
I've seen a few workaround with JavaSCript to set css on half a letter, but i would like to this with CSS.
My goal is to able to add class to the the right star web font to look like the left full star. The image is 2 diffrent icons, I want to able to create the "half" look on the star with CSS stroke effect on the web font of the icon.
This is codepen that has a one icon without the stroke CSS effect, one with CSS stroke. How can I set in the css the so the stroke effect will create half icon "full" and other half "empty"?
.empty {
-webkit-text-fill-color: white;
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: black;
}
I doubt this is possible in pure CSS, but if you can add some tags then it's straightforward to do by having two icons on top of each other, and clipping one with overflow: hidden.
HTML:
<span class="half-thumb">
<span class="mdi mdi-thumb-up"></span>
<span class="mdi mdi-thumb-up empty"></span>
</span>
CSS:
.half-thumb {
position: relative;
}
.half-thumb :first-child {
width: 50%;
overflow: hidden;
position: absolute;
}

Css Change Button Background Icon Colour [duplicate]

This question already has answers here:
How to modify the fill color of an SVG image when being served as background image?
(24 answers)
Closed 4 years ago.
Currently I create buttons with icons by using the button's background, like in my example (this is probably the reason for my problem).
I would like to know if it is possible to change the colour of the icon from the CSS? Because at the moment we have to save the same icon multiple times for different colors (black, white, colored versions etc.)
If this is not possible and I have to use , could someone please show me an example of making an svg type button and how to then change it's color.
.btn-icon {
border: 1px solid black;
height: 40px;
width: 40px;
padding: 0px;
background: url("https://image.flaticon.com/icons/svg/1034/1034153.svg");
background-size: cover;
}
<button class="btn-icon"></button>
For Adel's answer in this question Modify SVG fill color when being served as Background-Image
This seem to be an amazing solution for me:
.icon {
background-color: red;
-webkit-mask-image: url(icon.svg);
mask-image: url(icon.svg);
}
I think you should used
background-color: yellow;
In CSS

How to make custom shapes in Dreamweaver CS6 [duplicate]

This question already has answers here:
Wavy shape with css
(7 answers)
Closed 7 years ago.
Instead of inserting a shape.png, I want to create a custom shape in Dreamweaver. Can I create a shape using code? Please see the image attached.
You can do it using CSS. You can Watch Many SHAPES HERE...
When You need a Curvy Borders (As shown In the Shape.png ) Use
Border-radius:10px
//Or other properties are there!
Hope So You Know Css and its properties.
I have simple program for simple curve ...
Css file:
.box{
width:500px; height:100px;
border:solid 5px #000;
border-color:#000 transparent transparent transparent;
border-radius: 50%/100px 100px 0 0;
}
Html file:
<div class="box"></div>
Output:
You can make many Shapes using CSS...