<div class="example"></div>
<div class="wave"></div>
<style>
.example{
position: absolute;
right: 90px;
height: 100%;
width: 80px;
background-color: #bbbbb4;
}
.example::before{
content:"";
display: block;
position: absolute;
height: 100%;
width: 10px;
background:
linear-gradient(-135deg, #bbbbb4 5px, transparent 0) 0 5px,
linear-gradient(320deg, #bbbbb4 5px, transparent 0) 0 5px;
background-position: left top;
background-repeat: repeat-y;
background-size: 10px 10px;
left: -10px;
}
.wave{
position: absolute;
color: #bbbbb4;
width: 150px;
height: 100%;
overflow: hidden;
right: -60px;
}
.wave::before{
content: "";
display: block;
position: absolute;
width: 40px;
height: 50.1%;
background: #bbbbb4;
border-radius: 0 100% 0 0;
}
.wave::after{
content: "";
display: block;
position: absolute;
width: 40px;
height: 50.1%;
background: transparent;
border-radius: 0 0 0 100%;
border: solid #bbbbb4;
border-width: 0 0 0 2000px;
bottom: -0.5px;
right: 70px;
}
</style>
Content
The CSS content property allows you to add content outside of the HTML, that will not appear in the DOM.
The initial value for elements is normal. For ::before and ::after pseudo elements, normal computes to none and the elements do not render at all.
The content property must be set to an empty string if you wish to use the pseudo element for its shape only. Other common values are a string of text, an image, a counter, or open and close quotes.
<div>
<h1>Content Values</h1>
<ol>
<li>empty string</li>
<li>string</li>
<li>image</li>
<li>counter</li>
<li>open and close quotes</li>
</ol>
</div>
<style>
div{
padding: 10px;
background-color: #e4e4db;
color: #35353c
}
ol{
list-style: none;
counter-reset: li;
}
li{
counter-increment: li;
}
::before, ::after{
background-color: #bbbbb4;
}
li:nth-of-type(1)::before{
content: "";
display: inline-block;
width: 30px;
height: 20px;
}
li:nth-of-type(2)::before{
content: "This is the ::before content."
}
li:nth-of-type(3)::before{
content: url(./images/arrow.png);
}
li:nth-of-type(4)::before{
content: counter(li);
}
li:nth-of-type(5)::before{
content: open-quote;
}
li:nth-of-type(5)::after{
content: close-quote;
}
</style>
Content Values
- empty string
- string
- image
- counter
- open and close quotes