کنار نویس (aside)
تگ «کنار نویس (aside)» برای محتوای جانبی است. این محتوا به متن اصلی مرتبط است اما ضروری نیست. مثل باکس نکته کنار مقاله. مرورگر ظاهر خاصی نمی دهد؛ اما با CSS می شود خوشگلش کرد.
تعریف و کاربرد کنار نویس (aside)
کنار نویس یعنی بخشی مرتبط اما فرعی. مثلا خلاصه مکان، اصطلاح، یا تبلیغ. معمولا در سایدبار می آید. با محتوای اطراف باید ارتباط غیرمستقیم داشته باشد.
نمونه ساده کنار نویس
<p>My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!</p>
<aside>
<h4>Epcot Center</h4>
<p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p>
</aside>
استایل دهی کنار نویس با CSS
<html>
<head>
<style>
aside {
width: 30%;
padding-left: 15px;
margin-left: 15px;
float: right;
font-style: italic;
background-color: lightgray;
}
</style>
</head>
<body>
<h1>The aside element</h1>
<p>My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!</p>
<aside>
<p>The Epcot center is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p>
</aside>
<p>My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!</p>
<p>My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!</p>
</body>
</html>
سه گام عملی استفاده
- جای فرعی را مشخص کن. مثلا ستون کناری.
- محتوای مرتبط اما غیرضروری بنویس. خیلی کوتاه.
- با CSS آن را خواناتر کن. تضاد رنگی کمک می کند.
نکته: متن aside باید مستقل از بدنه هم معنا بدهد.
هشدار: اطلاعات حیاتی را داخل aside نگذار. کاربران از دست می دهند.
جمع بندی سریع
- کنار نویس برای محتوای جانبی است.
- ظاهر پیش فرض خاصی ندارد.
- محل رایج، سایدبار صفحه است.
- با CSS خوانایی را بهتر کن.