Sandwich Counter چالش 8 از جلسهی 2، سخت
یک شمارندهی ساندویچ برای اردوی کلاس بساز. صفحه dir="rtl" و viewport دارد. تو اینها را بنویس:
- دکمههای #plus و #minus با min-height: 44px و min-width: 44px
- #plus عدد p با id="count" را یکی زیاد کند
- #minus آن را یکی کم کند، ولی هیچوقت کمتر از 0 نشود
<!DOCTYPE html>
<html dir="rtl">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.screen { max-width: 420px; margin: 0 auto; text-align: center; }
#count { font-size: 40px; }
</style>
</head>
<body>
<div class="screen">
<h1>ساندویچ اردو</h1>
<p id="count">0</p>
<button id="minus">-</button>
<button id="plus">+</button>
</div>
<script>
</script>
</body>
</html>
راهنما و جواب این چالش · برگشت به درس جلسهی 2: صفحه برای گوشی
بیشتر بخوان: جاوااسکریپت چیست؟ از دکمهی وب تا Node.js