Image Size

ပံုေတြ ရဲ႕ အရြယ္အစားေျပာင္းခ်င္ရင္ေတာ့ width နဲ႕ height attribute ကို အသံုးျပဳႏိုင္ပါတယ္။

<img src="onepice_cover.jpg" width="150px">

အထက္ပါ code မွာ width ကို 150px ေပးထားပါတယ္။ height က width ရဲ႕ size ေပၚမွာ မူတည္ျပီး ratio အတိုင္း အလိုလုိ ေျပာင္းေပးပါတယ္။ တကယ္လုိ႕ height ကိုလည္း ပံုေသ value ေပးခ်င္တယ္ဆုိရင္ေတာ့ height attribute မွာ value ထည့္ေပးဖုိ႕လိုပါတယ္။

<img src="onepice_cover.jpg" width="160px" height="160px">

အထက္ပါ code မွာ ဆုိရင္ image ရဲ႕ width ေကာ height ေကာ က 160px ျဖစ္သြားပါလိမ့္မယ္။ pixel အျပင္ value ကို percentage နဲ႕လည္း ေပးလုိ႕ရပါတယ္။

<img src="onepice_cover.jpg" width="80%">

လက္ရိွ ပံု အရြယ္အစားရဲ႕ 80% ထိသာ ျပေတာ့မွာပါ။ တကယ္လို႕ ပံု အရြယ္အစားက 100px ျဖစ္ရင္ ျပတဲ့ အခါ ပံုအရြယ္အစားကို 80px အေနျဖင့္သာ ျပပါလိမ့္မယ္။ အခု ကၽြန္ေတာ္တုိ႕ရဲ႕ code ကို ေအာက္ကလို ျပင္လိုက္ပါမယ္။

<html>
<head>
    <title>Styling Text</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
    <h1>One Piece</h1>
    <h2>by Eiichiro Oda</h2>
    <ul class="menu">
        <li><a href="./home.html">Home</a></li>
        <li><a href="./anime.html">Anime</a></li>
        <li><a href="./download.html">Download</a></li>
    </ul>
        <img src="onepice_cover.jpg" width="150px">
    <p>One Piece is a Japanese <span class='highlight'>shounen manga series</span> written and illustrated by Eiichiro Oda. It has been serialized in Weekly Shōnen Jump since August 4, 1997; the individual chapters are being published in tankōbon volumes by Shueisha, with the first released on December 24, 1997, and the 70th volume released as of March 2013. One Piece follows the adventures of <span class='highlight'>Monkey D. Luffy</span>, a young boy whose body gains the properties of rubber after unintentionally eating a Devil Fruit, and his diverse crew of pirates, named the Straw Hat Pirates. Luffy explores the ocean in search of the world's ultimate treasure known as One Piece in order to become the next Pirate King.</p>
    <img src="images/luffy.png">
</body>
</html>

onepice_cover.jpg ကို width 150px နဲ႕ ျပပါလုိ႕ေရးထားပါတယ္။ ဒါေၾကာင့္ browser မွာ ၾကည့္လုိက္ရင္ ပံု size ေသးသြားတာကို ေတြ႕ပါလိမ့္မယ္။

Figure 5-5

Figure 5-5

results matching ""

    No results matching ""