الصفحة الرئيسية
تحميل الكود
تغيير الألوان
تغيير العرض
تغيير حجم العرض
تشغيل الكود
<!DOCTYPE html> <html> <head> <style> #demo { width: min(50%, 300px); border: 1px solid black; background: bisque; padding: 10px; box-sizing: border-box; } </style> </head> <body> <h1>CSS min Function</h1> <div id="demo">The smaller value is used as width.</div> <p>If 300px is smaller than 50% where the element is shown, then 300px will be set as its width. But if 50% is smaller than 300px where the element is shown, then 50% will be set as its width.</p> <p>Note: Resize the screen to notice the change.</p> </body> </html>