shape-outside ගුණය
shape-outside ගුණය පාවෙන අංග සඳහා සම්මත නොවන ගලායාමේ හැඩතල නිර්ණය කිරීමට ඉඩ සලසයි.
අසල්වැසි අංග තිරස් අවකාශීය බහාලුම වෙනුවට නිර්ණය කළ
හැඩය වටා ගලා යනු ඇත.
වාක්ය රීතිය
තේරුම්ගන්නා {
shape-outside: අගය;
}
අගයන්
| අගය | විස්තරය |
|---|---|
circle() |
වටකුරු ගලායාමේ හැඩය |
ellipse() |
ඉලිප්සාකාර ගලායාමේ හැඩය |
polygon() |
අත්තනෝමතික බහුඅස්ර හැඩය |
url() |
පින්තූරයේ ඇල්ෆා-කාණ්ඩය මත පදනම් වූ හැඩය |
margin-box |
margin සීමාවන් භාවිතා කරන්න (පෙරනිමි අගය) |
නිදර්ශනය
පාවෙන අංගය සඳහා වටකුරු ගලායාමේ හැඩයක් සාදමු.
shape-outside සහ
clip-path ගුණ භාවිතා කරමු:
<div class="shape"></div>
<p>
some long text
</p>
.shape {
width: 150px;
height: 150px;
float: left;
shape-outside: circle(50%);
clip-path: circle(50%);
background: #3498db;
}
p {
width: 500px;
text-align: justify;
}
:
නිදර්ශනය
shape-margin ගුණය හරහා ඉඩ පරතරයක් නිර්ණය කරමු:
<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;
}
:
නිදර්ශනය
clip-path ගුණය නොමැතිව, පෙළ
වටය වටා ගලා යන නමුත් අංගයට
වටකුරු හැඩයක් නොමැත:
<div class="shape"></div>
<p>
some long text
</p>
.shape {
width: 150px;
height: 150px;
float: left;
shape-outside: circle(50%);
background: #3498db;
}
p {
width: 500px;
text-align: justify;
}
:
නිදර්ශනය
අංගයේ වෙනත් හැඩයක්:
<div class="shape"></div>
<p>
some long text
</p>
.shape {
width: 200px;
height: 200px;
background-color: #4CAF50;
float: left;
shape-outside: polygon(0% 0%, 100% 50%, 0% 100%);
clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
margin-right: 20px;
margin-bottom: 20px;
}
p {
width: 500px;
text-align: justify;
}
:
නිදර්ශනය
අංගයේ වෙනත් හැඩයක්:
<div class="shape"></div>
<p>
some long text
</p>
.shape {
width: 200px;
height: 200px;
background-color: #4CAF50;
float: left;
shape-outside: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
margin-right: 20px;
margin-bottom: 20px;
}
p {
width: 500px;
text-align: justify;
}
:
මෙයද බලන්න
-
clip-pathගුණය,
අංගයේ දෘශ්යමය හැඩය නිර්මාණය කරයි -
floatගුණය,
shape-outside ක්රියා කිරීම සඳහා අවශ්ය වේ -
shape-marginගුණය,
හැඩය වටා ඉඩ පරතරයක් එකතු කරයි