HTML FORMS /
Responsive Forms, Components & Image
/
Responsive Div with Variable Text Size
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .example { width : 100%; background-color: #1e1e1c; padding: 20px; color : white; } @media screen and (min-width: 768px) { .example { font-size: 80px; padding :30px; } } @media screen and (max-width: 768px) { .example { width : 100vh; font-size: 30px; padding : 10px; } } </style> </head> <body> <h2>Responsive Div with Varible Text Size</h2> <div class="example">Sample</div> </body> </html>