GoogleI want the same big"> Why are the resulting (after running the html/css code) box sizes of the div and label different when applying the same set of properties?-PHP Chinese Network Q&A
Why are the resulting (after running the html/css code) box sizes of the div and label different when applying the same set of properties?
P粉788571316
P粉788571316 2023-09-12 18:39:31
0
1
338

div, a { height: 100px; width: 200px; border: 5px solid black; margin: 15px; }
This is a div tag
Google

I was expecting the same size box but found a different one.

P粉788571316
P粉788571316

reply all (1)
P粉066224086

Just adddisplay: block;to your CSS.

like this:

div, a { display: block; height: 100px; width: 200px; border: 5px solid black; margin: 15px; }
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!