in conclusion
Case Be sure to copy the code and run it again, and spend a few minutes to experience how to be wrapped by the parent and break through the parent's restrictions Width Case <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> * { margin: 0;padding: 0; } body { background: #dcdcdc; } .box { width: 400px; border: 3px solid red; padding: 0 50px; } .box1 { width: auto; height: 100px; background: pink; padding: 0 50px; margin: 0 50px; border-width: 0 50px; border-style: solid; border-color: green; } .box2 { width: 100%; height: 100px; background: gold; padding: 0 50px; margin: 0 50px; border-width: 0 50px; border-style: solid; border-color: green; } </style> </head> <body> <div class="box"> <div class="box1"></div> <div class="box2"></div> </div> </body> </html> Height Case <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> * { margin: 0;padding: 0; } body { background: #dcdcdc; } .box { width: 400px; border: 3px solid red; padding: 50 0px; height: 400px; } .box1 { width: 200px; height:auto; background: pink; padding: 50px 0px; margin: 50px 0px; border-width: 50px 0px; border-style: solid; border-color: green; } .box2 { width: 200px; height:100%; background: gold; padding: 50px 0px; margin: 50px 0px; border-width: 50px 0px; border-style: solid; border-color: green; } </style> </head> <body> <div class="box"> <div class="box1"></div> <div class="box2"></div> </div> </body> </html> This is the end of this article about the default values of width and height in CSS, auto and % cases. For more relevant CSS width and height default values, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! |
<<: How to automatically start RabbitMq software when centos starts
>>: Practice of implementing custom search bar and clearing search events in avue
Step 1: Configure environment variables (my decom...
The effect is as follows:Reference Program: <!...
systemd: The service systemctl script of CentOS 7...
Due to the limitation of CPU permissions, communi...
It's easy to send messages to other users in ...
1. First remotely connect to the server 2. Open S...
1.17.9 More delicious, really Nginx download addr...
I recently used a Mac system and was preparing to...
On many websites, we have seen the input box disp...
transform and translate Transform refers to trans...
Three times of memorization allows you to remembe...
Uninstall MariaDB CentOS7 installs MariaDB instea...
The nginx configuration is as follows: Such as ht...
MySQL advantage: Small size, fast speed, low tota...
Enable remote access Enable remote access rights ...