Answers for "Square css"

CSS
0

how to make a square div in css

.square {
    background-color: #000;
    width: 50vw;
    height: 50vw;
}
.square h1 {
    color: #fff;
}
/* It works */
Posted by: Guest on May-26-2021
5

how to create a shape in css

div {
	clip-path: polygon(100% 100%, 100% 100%, 100% 100%)
}
Posted by: Guest on June-27-2020
1

how to make a responsive box in css

.square {
  width: 50%;
}

.square:after {
  content: "";
  display: block;
  padding-bottom: 100%;
}
Posted by: Guest on October-23-2020
1

responsive square css

<!-- HTML -->
<div class='square-box'>
    <div class='square-content'>
        <h3>test</h3>
    </div>
</div>

<!-- CSS -->
<style>
.square-box{
    position: relative;
    width: 50%;
    overflow: hidden;
    background: #4679BD;
}
.square-box:before{
    content: "";
    display: block;
    padding-top: 100%;
}
.square-content{
    position:  absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    color: white;
    text-align: center;
}
</style>
Posted by: Guest on June-10-2021

Browse Popular Code Answers by Language