How to do the css template layout? [duplicate] - html

This question already has answers here:
draw diagonal lines in div background with CSS
(13 answers)
Closed 4 years ago.
I want is to have something like this effect.
I tried to make a css template by following the picture above, but I don't know how to do it?
Do you can make css effect according to the above picture?

You can use 2D Transformation (https://www.w3schools.com/css/css3_2dtransforms.asp).
.line1 {
width: 112px;
height: 47px;
border-bottom: 1px solid red;
-webkit-transform:
translateY(-20px)
translateX(5px)
rotate(27deg);
position: absolute; }
Here is an example in JSFiddle

Related

Change text color based on its background [duplicate]

This question already has answers here:
Text blended over background color
(1 answer)
Dual-Color Text
(2 answers)
black and white text based on background image with css
(2 answers)
Closed 11 months ago.
So, I was practicing in HTML and CSS as usual and yesterday I started working on a PSD template. It seemed easy for me, but in a few seconds, I bunched in the issue that I am talking about right now.
In general, I want to change the exact part of a text based on its background. I've already tried "mix-blend-mode", but unfortunately, the result wasn't satisfying for me.
Here is what I want.
So, as you can see the text before the center is white-colored, but the text after the center has the same color as the background before the center.
Is there any way to do that using CSS or maybe even Javascript.
You could do something like this:
<style>
.container {
display:block;
position:relative;
width:150px;
height:50px;
text-align: center;
}
.black-half div {
background: #000;
color: #fff;
}
.white-half div {
background: #fff;
color: #000;
width:150px;
}
.white-half {
height: 100%;
width: 50%;
overflow: hidden;
position: absolute;
}
.black-half {
height: 100%;
position: absolute;
}
</style>
<div class="container">
<div class="black-half">
<div>Split background and text color</div>
</div>
<div class="white-half">
<div>Split background and text color</div>
</div>
</div>

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

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.

how to make a div show [duplicate]

This question already has answers here:
HTML Div border not showing
(3 answers)
Closed 2 years ago.
I am trying to make a foot print for a cool look, but it won't show
here's my code:
.footprint {
width: 100px;
height: 50px;
border-color: gray;
border: 3px;
border-radius: 20px;
}
<div class="footprint"></div>
welcome to SO!
Somebody already found a solution to your problem here:
CSS Property Border-Color Not Working
A div by default has no border-style and no border-width, therefore the border will not be shown.

Create round corner image by CSS [duplicate]

This question already has answers here:
How to draw circle in html page?
(19 answers)
Creating rounded corners using CSS [closed]
(21 answers)
Draw Circle using css alone [duplicate]
(6 answers)
Closed 7 years ago.
I want to create image avatar like avatar contact of skype,can you help me ?, I try use border radius-border but lucky
I think you can use border-radius on img tags, too.
img{
border-radius: 50%;
}
<img src="https://c2.staticflickr.com/4/3016/3071708735_ddaf5d361b.jpg" alt="">
Try like this: Demo
div.avatar {
border-radius:50%;
overflow:hidden;
width:100px;
height:100px;
border:1px solid #ccc;
}
div.avatar img {
height:100%;
}
HTML:
<div class="avatar">
<img src="http://www.stockazoo.com/uploads/3/5/4/5/3545172/5579090_orig.jpg" />
</div>
CSS:
.circleImage {
width: 300px;
height: 300px;
border-radius: 50%;
background: green;
}
HTML:
<div class="circleImage"></div>
Keep the border radius half of the width or height for circular images like in Skype.

Why won't CSS class work in browser? [duplicate]

This question already has answers here:
Is there a reason why CSS doesn't support ids and classes, starting from numbers?
(8 answers)
Closed 8 years ago.
I have this html;
<div class="1"><br/>hi</div>
<div class="2"><br/>hi</div>
<div class="3"><br/>hi</div>
<div class="4"><br/>hi</div>
and then I added normal CSS formatting to the divs;
div{
height: 100px;
width: 100px;
border-radius: 100%;
margin: 20px;
display: inline-block;
text-align: center;
}
and then i wanted each div to be a different colour so I used the classes like this;
.1{
background-color: pink;
}
.2{
background-color: red;
}
.3{
background-color: orange;
}
.4{
background-color: yellow;
}
I am writing this in dreamweaver and when i click on the divs the little class thing tells me that they are coloured and the code is working, but when i preview in a browser the colours are not showing up and I just get the div part of the CSS.
it's probably very obvious but I can't think of why this is happening.
Thanks :)
Please avoid using classes with number at the beginning. It will fail for sure.
You can use for example cl1, cl2, cl3, etc.