Calculation of the box model <br />Margin + border + padding + content The width and height in CSS only set the height and width of the content area. Not the height and width of the entire model. Copy code The code is as follows:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>demo</title> <style type="text/css"> *{margin:0; padding:0;} dl { background:red;border:10px solid #000; width:100px; height:100px;} dt { background:yellow;} dd { background:green;} </style> </head> <body> <dl> <dt>test of dt</dt> <dd>test of dd</dd> </dl> </body> </html> Setting margins and padding will not affect the height and width of the content area, but only change the height and width of the secondary box model area. When the box models are nested, the inner box model will affect the outer box model. |
<<: The actual process of implementing the guessing number game in WeChat applet
>>: The difference between animation and transition
Table of contents Preface 1. Tomcat class loader ...
Table of contents Concept Introduction Logical ru...
The paging effect is implemented in the vue proje...
The so-called sliding door technology means that ...
1. Varnish Overview 1. Introduction to Varnish Va...
Optimize queries Use the Explain statement to ana...
How to configure custom path aliases in Vue In ou...
Table of contents Environment Setup Overview 1.Wh...
Effect: <div class="imgs"> <!-...
Table of contents Preface: Ubuntu 18.04 changes a...
1. Block-level element: refers to the ability to e...
<a href="http://" style="cursor...
1. Docker pull pulls the image When using $ docke...
What are :is and :where? :is() and :where() are p...
Simple XHTML web form in web design 5. Technique ...