<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatib1e" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> < link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div class="parent"> <div class="child"></div> </div> </body> </html> file style.css .parent{ background-color: blue; width: 50%; height: 200px; } .child background-color : red; width: 50%; <!-- اگر بگذاریم یعنی 50 درصد کل صفحه رو در بر بگیر و دیگه از پرنت خودش استفاده نمی کنه width:50vw;--> height: 200px; }