Īpašība shape-margin
Īpašība shape-margin nosaka atstarpi ap formu,
kas definēta ar īpašību shape-outside.
Tas ļauj palielināt attālumu starp formu un to apjožošo tekstu.
Sintakse
selektors {
shape-margin: vērtība;
}
Piemērs
Aplis ar atstarpi 20px:
<div class="shape"></div>
<p>
some long text
</p>
.shape {
width: 150px;
height: 150px;
float: left;
shape-outside: circle(50%);
shape-margin: 10px;
clip-path: circle(50%);
background: #3498db;
}
p {
width: 500px;
text-align: justify;
}
:
Piemērs
Trijstūris ar atstarpi 1em:
<div class="shape"></div>
<p>
some long text
</p>
.shape {
width: 150px;
height: 150px;
float: left;
shape-outside: polygon(0% 0%, 100% 50%, 0% 100%);
shape-margin: 1em;
clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
background: #e74c3c;
}
p {
width: 500px;
text-align: justify;
}
:
Skatiet arī
-
īpašība
shape-outside,
kas nosaka formu apšuvumam -
īpašība
clip-path,
kas izveido redzamu elementa formu -
īpašība
float,
kas nepieciešama shape-margin darbībai