ඔයාට web එකක් හදනකොට හොඳ layout එකක් ඕනෙ නේද? 😎
HTML එකේ element එකක් page එකේ කොහෙද තියෙන්නෙ කියලා Display සහ Position decide කරනවා.
එහෙනම් එයා හොඳට ගියාම, web එකක් professional එකට හැදෙයි 💪
CSS display
කියන්නේ element එක block එකක්ද? inline එකක්ද? කියලා කියන එක.
block
display: block;
<div>
, <p>
, <h1>
...inline
display: inline;
<span>
, <a>
...inline-block
display: inline-block;
none
display: none;
position
කියන එකෙන් CSS එකට කියනවා "මෙම element එක web එකේ කොහෙද තියෙන්න ඕනේද?" කියලා.
static
(default)position: static;
relative
position: relative; top: 10px; left: 20px;
absolute
position: absolute; top: 0; left: 0;
fixed
position: fixed; bottom: 0; right: 0;
sticky
position: sticky; top: 0;
relative
+ fixed
.<div class="box1">Static Box</div> <div class="box2">Relative Box</div> <div class="box3">Absolute Box</div> .box1 { position: static; } .box2 { position: relative; top: 20px; left: 10px; } .box3 { position: absolute; top: 0; right: 0; }
👉 Try karala balanna dev tools වලට ගිහින් 🔍
Display සහ Position දෙකම තමයි ඔයාගේ layout එක "මිනිස්සුන්ට දැක්කම wow!" කියන්න හේතු වෙන reason එක! 😍
➡️ එහෙනම් ඊලඟ lesson එකට ඔයාලා එන්න Flexbox සෙට් එකට!
අද ලියපු code උන්ව test කරලා බලන්න – ආදරෙන්ම කියනවා:
👉 "Try karala balapan, break karala balapan!" 💻🧪
🙌 අනේ ඔයාලගේ support එක එලියට එන්න පුලුවන්. Like එකක්, Comment එකක්, Share එකක් – ඔයාලගෙ ඉස්සරහටම content එක ගන්න! ❤️✨
📦👉 ඊලඟ පාඩම: CSS Flexbox – ඒකෙන් responsive layouts ගහන්න හැමකෙනාටම ලේසි! 🧘♂️🧭
Ready වෙලා ඉන්න!
Member since 2025-04-09 13:55:06
Comments
Please login to post a comment.
No comments yet. Be the first to comment!