Add an Image as a Figure
<figure>
ကို အဓိက စာေတြနဲ႕ အတူ ပံုေတြကို ေခါင္းစီးနဲ႕ တြဲျပီး ျပဖို႕အတြက္ အသံုျပဳႏိုင္ပါတယ္။ ဥပမာ ။။ ေက်ာင္းစာေတြထဲမွာ ပံုကို ရည္ညႊန္းျပီးေတာ့ ပံုေတြ ဇယားေတြ စတာေတြပါလာတတ္ပါတယ္။ အဲဒီအခါမွာ ကၽြန္ေတာ္တုိ႕ေတြ အေနနဲ႕ <figcaption>
ကို <figure>
အထဲမွာ ထည့္ျပီး ညႊန္းထားတဲ့ ေခါင္းစဥ္ အေနနဲ႕ ေဖာ္ျပလုိ႕ရပါတယ္။
index.html မွာ figure ထပ္ျဖည့္လိုက္ပါတယ္။
<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" title="One Piece Cover" width="150px" height="200px" alt="onepice cover">
<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>
<figure>
<img src="images/luffy.png" alt="Luffy" title="Luffy">
<figcaption>Luffy</figcaption>
</figure>
</body>
</html>
ျပီးေတာ့ style.css မွာ figure နဲ႕ figurecaption ကို ထပ္ျဖည့္ပါတယ္။
body {
font-family: "Zawgyi-One",arial;
background-color: #ECF0F1;
}
.highlight {
background-color: #F1C40F;
}
h1 {
font-size: 40px;
color: green;
font-family: "Times New Roman",serif;
text-align: center;
letter-spacing: 10px;
}
h2 {
font-size: 25px;
color: #336699;
font-family: "Verdana",arial;
text-align: center;
text-transform: uppercase;
}
p {
text-indent: 20px;
line-height: 40px;
}
.menu {
list-style: none;
padding: 0px;
text-align: center;
}
.menu li {
display: inline;
padding: 5px;
}
.menu li a{
text-decoration: none;
color:#E74C3C;
border-bottom: 1px dotted #E74C3C;
}
figure {
padding:10px;
padding-bottom: 0px;
width: 230px;
background-color:#16A085;
}
figcaption {
padding-top:8px;
font-weight: bold;
text-align: center;
color:#FFF;
}
အဲဒီ code ကို browser မွာဆိုရင္ ေအာက္ပံုလုိျမင္ရပါမယ္။
Figure 5-8
figure ရဲ႕ width ကို 230px
ေပးထားပါတယ္။ background ကို အစိမ္းရင့္ေရာင္ သံုးထားပါတယ္။ figure ရဲ႕ caption ကိုေတာ့ အျဖဴေရာင္ သံုးျပီး bold လုပ္ထားပါတယ္။ figure နဲ႕ figurecaption ဟာ css နဲ႕ တြဲျပီး သံုးမွသာ အဆင္ေျပပါတယ္။