How to make parts of div border invisible - css

Good day to everyone. Just don't know how to remove central part of div#additionalBorder. I thought I could do it with inner div#partition but got stuck. Is it possible to do it in such way?
Or may be I should use pseudo elements ::before.
Here 's screen of what I mean:
#outerCircle {
display: flex;
flex-wrap: wrap;
margin: 0 auto;
width: 560px;
border: 2px dotted grey;
position: relative;
}
.bigButton {
height: 250px;
width: 250px;
border: solid #464646;
}
#greenButton {
background-color: #23a846;
border-radius: 100% 0 0 0;
border-width: 20px 10px 10px 20px;
}
#redButton {
background-color: #a50005;
border-radius: 0 100% 0 0;
border-width: 20px 20px 10px 10px;
}
#yellowButton {
background-color: #a7a408;
border-radius: 0 0 0 100%;
border-width: 10px 10px 20px 20px;
}
#blueButton {
background-color: #162da7;
border-radius: 0 0 100% 0;
border-width: 10px 20px 20px 10px;
}
div#innerCircle {
border: 15px solid #464646;
border-radius: 50%;
position: absolute;
top: 25%;
right: 25%;
background-color: aliceblue;
}
div.additionalBorder {
margin: 4px;
border: 2px solid black;
border-radius: 50%;
height: 238px;
width: 238px;
overflow: hidden;
}
p#tradeMark {
margin: auto;
height: 102px;
text-align: center;
font-size: 68px;
font-family: myDirector;
color: aliceblue;
background-color: black;
border-color: antiquewhite;
line-height: 140px;
}
span#reg {
font-size: 9px;
}
.partition {
height: 7px;
}
.buttons {
height: 130px;
border-top: 2px solid black;
display: flex;
flex-direction: column;
justify-content: space-around;
}
<div id="outerCircle">
<div class="bigButton" id="greenButton"></div>
<div class="bigButton" id="redButton"></div>
<div class="bigButton" id="yellowButton"></div>
<div class="bigButton" id="blueButton"></div>
<div class="bigButton" id="innerCircle">
<div class="additionalBorder">
<p id="tradeMark">simon<span id="reg">®</span>
</p>
<div class="partition"></div>
<div class="buttons"></div>
</div>
</div>

i just change this classes. i removed border from "div.additionalBorder" and add border, border-radius to ".buttons".
div.additionalBorder {
border-radius: 50%;
margin: 4px;
height: 242px;
width: 242px;
overflow: hidden;
}
.buttons {
border: 2px solid black;
border-radius: 0 0 130px 130px;
height: 130px;
display: flex;
flex-direction: column;
justify-content: space-around;
}
#outerCircle {
display: flex;
flex-wrap: wrap;
margin: 0 auto;
width: 560px;
border: 2px dotted grey;
position: relative;
}
.bigButton {
height: 250px;
width: 250px;
border: solid #464646;
}
#greenButton {
background-color: #23a846;
border-radius: 100% 0 0 0;
border-width: 20px 10px 10px 20px;
}
#redButton {
background-color: #a50005;
border-radius: 0 100% 0 0;
border-width: 20px 20px 10px 10px;
}
#yellowButton {
background-color: #a7a408;
border-radius: 0 0 0 100%;
border-width: 10px 10px 20px 20px;
}
#blueButton {
background-color: #162da7;
border-radius: 0 0 100% 0;
border-width: 10px 20px 20px 10px;
}
div#innerCircle {
border: 15px solid #464646;
border-radius: 50%;
position: absolute;
top: 25%;
right: 25%;
background-color: aliceblue;
}
div.additionalBorder {
border-radius: 50%;
margin: 4px;
height: 242px;
width: 242px;
overflow: hidden;
}
p#tradeMark {
margin: auto;
height: 102px;
text-align: center;
font-size: 68px;
font-family: myDirector;
color: aliceblue;
background-color: black;
border-color: antiquewhite;
line-height: 140px;
}
span#reg {
font-size: 9px;
}
.partition {
height: 7px;
}
.buttons {
border: 2px solid black;
border-radius: 0 0 130px 130px;
height: 130px;
display: flex;
flex-direction: column;
justify-content: space-around;
}
<div id="outerCircle">
<div class="bigButton" id="greenButton"></div>
<div class="bigButton" id="redButton"></div>
<div class="bigButton" id="yellowButton"></div>
<div class="bigButton" id="blueButton"></div>
<div class="bigButton" id="innerCircle">
<div class="additionalBorder">
<p id="tradeMark">simon<span id="reg">®</span>
</p>
<div class="partition"></div>
<div class="buttons"></div>
</div>
</div>

Related

How can I center this container in the middle of the screen in CSS?

This CSS is displayed on the second page of a scrolling page. The .container_block is for holding all the cards in its box. The .cards are for displaying the cards and each individual card is represented by card1,2,3, and 4.
.container_block {
width: 80%;
height: 40%;
display: block;
background-color: red;
margin: auto;
}
.cards {
display: flex;
align-items: center;
justify-content: center;
}
.cards h2 {
font-size: 25px;
color: white;
margin: 15px;
}
.cards p {
font-size: 20px;
color: white;
margin: 15px;
}
.card1 {
box-shadow: 1px 1px 8px 6px rgba(0,0,0,0.2);
transition: 0.3s;
height: 30vh;
width: 30vh;
border-radius: 20px;
margin-top: 4vh;
margin-right: 5vh;
}
.card2 {
box-shadow: 1px 1px 8px 6px rgba(0,0,0,0.2);
transition: 0.3s;
height: 30vh;
width: 30vh;
border-radius: 20px;
margin-top: 4vh;
margin-right: 5vh;
}
.card3 {
box-shadow: 1px 1px 8px 6px rgba(0,0,0,0.2);
transition: 0.3s;
height: 30vh;
width: 30vh;
border-radius: 20px;
margin-top: 4vh;
margin-right: 5vh;
}
.card4 {
box-shadow: 1px 1px 8px 6px rgba(0,0,0,0.2);
transition: 0.3s;
height: 30vh;
width: 30vh;
border-radius: 20px;
margin-top: 4vh;
margin-right: 5vh;
}
Any tips on simplifying code will also be greatly appreciated!
in .container_block, try replacing "margin: 0;" with "margin: 0 auto;"
Just Wrap the container_block division by another division and name in wrapper.
Apply the below CSS.
Also No need to make multiple Card classes if you are applying same CSS to them
just use one class name in all divisions.
.wrapper{
width:100%;
height:100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container_block {
width: 80%;
height: 40%;
display: block;
background-color: red;
margin: auto;
}
.cards {
display: flex;
align-items: center;
justify-content: center;
}
.cards h2 {
font-size: 25px;
color: white;
margin: 15px;
}
.cards p {
font-size: 20px;
color: white;
margin: 15px;
}
.card1 {
box-shadow: 1px 1px 8px 6px rgba(0,0,0,0.2);
transition: 0.3s;
height: 30vh;
width: 30vh;
border-radius: 20px;
margin-top: 4vh;
margin-right: 5vh;
}

Double border CSS

I have been working on a project and I was able to create a double border css with box shadow... but the problem is I need a transparency on the first box..
I tried something:
* {
box-sizing: border-box;
}
body {
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
}
.box {
width: 5rem;
height: 3rem;
background-color: #789;
border: 3px solid black;
box-shadow: 8px -8px 0 -3px #ccc, 8px -8px 0 0 #000;
}
<div class="box"></div>
I need http://prntscr.com/nw6fed - the background of the first box should be transparent...Any help
You can get your second border with a pseudo element. I used :after in this example.
.box {
width: 200px;
height: 200px;
border: 3px solid cyan;
position: relative;
padding: 40px;
box-sizing: border-box;
}
.box::after {
content: '';
height: 100%;
width: 100%;
position: absolute;
display: block;
top: 20px;
left: 20px;
border: 3px solid magenta;
}
<div class="box">
<h1>Text</h1>
</div>

checkmark/tick inside a circle (icon) using pure css3

I'm trying to draw a circle with tick/checkmark inside it using pure css3
.success-checkmark {
content: '✔';
position: absolute;
left:0; top: 2px;
width: 17px; height: 17px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
How can i achieve i have tried with the above code?
You can use content: '✔'; only on pseudo elements, so try using the following selector:
.success-checkmark:after {
content: '✔';
position: absolute;
left:0; top: 2px;
width: 20px;
height: 20px;
text-align: center;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
<div class="success-checkmark"></div>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
.circle {
position: relative;
background: #00B01D;
border-radius: 100%;
height: 120px;
width: 120px;
}
.checkMark {
position: absolute;
transform: rotate(50deg) translate(-50%, -50%);
left: 27%;
top: 43%;
height: 60px;
width: 25px;
border-bottom: 5px solid #fff;
border-right: 5px solid #fff;
}
<div class="wrapper">
<div class="circle">
<div class="checkMark"></div>
</div>
</div>
I found a template online to which I made modifications. Kindly check if this works for you.
:root {
--borderWidth: 7px;
--height: 25px;
--width: 12px;
--borderColor: white;
}
body {
padding: 20px;
text-align: center;
}
.check {
display: inline-block;
transform: rotate(45deg);
height: var(--height);
width: var(--width);
border-bottom: var(--borderWidth) solid var(--borderColor);
border-right: var(--borderWidth) solid var(--borderColor);
}
.behind {
border-radius: 50%;
width: 40px;
height: 40px;
background: black;
}
<div class="behind">
<div class="check">
</div>
</div>
css
.success-checkmark:after {
content: '✔';
position: absolute;
text-align: center;
line-height:20px;
}
vertical adjustment
line-height:20px;<--- adjust vertical alignment
.success-checkmark:after {
content: '✔';
position: absolute;
text-align: center;
line-height:20px;
width: 90px;
height: 90px;
border: 1px solid #aaa;
background: #f8f8f8;
border-radius: 50%;
box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
}
<div class="success-checkmark"></div>

How to do continuous arrow boxes in CSS HTML

any idea how to do something like this?
i know they're just boxes with modifications to css but Im new to css so any kind of help would be useful. thank you
im doing this by doing the following below. But there is a space in between the boxes. I wanted to achieve the arrow covering the space between each box
.box {
display: block;
width: 100%;
margin: 0 auto;
padding: 50px 20px;
text-align: center;
overflow: hidden;
}
.box-item {
display: block;
position: relative;
float: left;
width: calc(100% / 3 - 7px);
height: 40px;
line-height: 40px;
margin-right: 10px;
padding: 0 10px;
background-color: #3a7cca;
border-radius: 4px;
color: #ffffff;
}
.box-item:before {
content: "";
position: absolute;
right: -9px;
height: 0;
width: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 10px solid #3a7cca;
border-radius: 4px;
}
.box-item:after {
content: "";
position: absolute;
left: -1px;
height: 0;
width: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 10px solid #fff;
border-radius: 4px;
}
.box-item:first-child:after {
display: none;
}
.box-item:last-child {
margin-right: 0;
}
.box-item:last-child:before {
display: none;
}
Try to use display: flex and flex-direction: row-reverse for the parent block. So each next .box-item will be placed "under" the previous, and you will be able to adjust space between items by changing margin-right.
.box {
display: flex;
flex-direction: row-reverse;
padding: 50px 20px;
}
.box-item {
align-items: center;
background: #3a7cca;
border-radius: 4px;
color: white;
display: flex;
flex-grow: 1;
height: 40px;
justify-content: center;
margin-right: 2px;
position: relative;
}
.box-item:before,
.box-item:after {
border-color: transparent;
border-style: solid;
border-width: 20px 0 20px 10px;
border-radius: 4px;
content: "";
height: 0;
position: absolute;
top: 0;
width: 0;
}
.box-item:before {
left: -1px;
border-left-color: white;
}
.box-item:after {
right: -9px;
border-left-color: #3a7cca;
}
.box-item:first-child {
margin-right: 0;
}
.box-item:last-child:before,
.box-item:first-child:after {
display: none;
}
<div class="box">
<div class="box-item">3</div>
<div class="box-item">2</div>
<div class="box-item">1</div>
</div>

css overflow hidden can't cover all element?

.powder-box {
width: 51px;
height: 51px;
border-radius: 50%;
border: 2px solid #A5B2B5;
box-shadow: 0 1px 2px 0px #A5B2B5;
overflow: hidden;
position: relative;
}
.powder-inner {
width: 45px;
height: 45px;
border: 2px solid white;
border-radius: 50%;
box-shadow: 0 4px 10px 0 #656565;
background-color: #00c690;
overflow: hidden;
margin: 1px;
}
.powder-wave {
background-color: white;
height: 70px;
}
<div class="powder-box">
<div class="powder-inner">
<div class="powder-wave" style="margin-top: -54px"></div>
</div>
</div>
.powder-inner overflow hidden ,there have a border in there . it can't cover all .
how can i cover all ? there is border there ?
Update .powder-inner class using border-top-left-radius: 0%; & border-top-right-radius: 0%; then remove top green curve.
See output is browser zoom it and see green curve.
.powder-inner {
width: 45px;
height: 45px;
border: 2px solid white;
border-radius: 49%;
box-shadow: 0 4px 10px 0 #656565;
background-color: #00c690;
overflow: hidden;
margin: 1px;
z-index: 2000;
border-top-left-radius: 0%;
border-top-right-radius: 0%;
}
.powder-box {
width: 51px;
height: 51px;
border-radius: 50%;
border: 2px solid #A5B2B5;
box-shadow: 0 1px 2px 0px #A5B2B5;
overflow: hidden;
position: relative;
}
.powder-inner {
width: 45px;
height: 45px;
border: 2px solid white;
border-radius: 49%;
box-shadow: 0 4px 10px 0 #656565;
background-color: #00c690;
overflow: hidden;
margin: 1px;
z-index: 2000;
border-top-left-radius: 0%;
border-top-right-radius: 0%;
}
.powder-wave {
background-color: white;
height: 70px;
}
<div class="powder-box">
<div class="powder-inner">
<div class="powder-wave" style="margin-top: -54px"></div>
</div>
</div>
.powder-box {
width: 51px;
height: 51px;
border-radius: 50%;
border: 2px solid #A5B2B5;
box-shadow: 0 1px 2px 0px #A5B2B5;
overflow: hidden !important;
position: relative;
}
.powder-inner {
width: 45px;
height: 45px;
border: 2px solid white;
border-radius: 50%;
box-shadow: 0 4px 10px 0 #656565;
background-color: #00c690;
overflow:hidden !important;
margin: 1px;
}
.powder-wave {
background-color: white;
height: 70px;
}
<div class="powder-box">
<div class="powder-inner">
<div class="powder-wave" style=""></div>
</div>
</div>

Resources