Why does a tag with the same code fail?

The hover effect of the

div tag is effective. Change to the invalidation solution principle of the p tag?

<!--  -->
<style>
     :root{
         --mainTheme:-sharpf4f4f4;
         --mainFont: -sharp666;
         --dropTheme:yellowgreen;
     }
     body{
         background: var(--mainTheme);
         color: var(--mainFont);

     }
    .dropdown-content { display: none;  background: var(--dropTheme)}
            
    .dropdown:hover .dropdown-content { display: block; }
    </style>
    <!--  -->
    <body>
    <p class="dropdown">
        <span></span>
        <div class="dropdown-content">
        

hello world

</div>

<div class="dropdown"> <span></span> <div class="dropdown-content">

hello world

</div> </div> </body>
Css
Mar.18,2021

there is a problem with the nesting of your tags. The p tag cannot nest div tags, and the browser will parse it into
clipboard.png
pp
,,,

clipboard.png

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e8a1-2c408.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e8a1-2c408.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?