css-unit-relative-percent
RUN
<!DOCTYPE html> <html> <head> <style> div.parent { background-color: red; width: 500px; } div.child { width: 50%; border: 1px solid black; background-color: yellow; } </style> </head> <body> <div class="parent"> <div class="child">Phần tử div con có width là 50% so với thẻ div cha, vậy phần tử div con có width là 250px.</div> <div> </body> </html>
PHÓNG TO