position: absolute;
Top: - 10 px;
Z - index: 2000! important;
Left: 100%;
Background: # FFF! important;
Border - the radius: 0 px 0 5 px;
padding:10px;
Width: auto;
Min - height: 300 px;
Border: # 2 px solid DDD;
}
The children {
display: inline-block;
}
The above code, it is not open, the width of the parent of the solution
CodePudding user response:
Don't quite understand your question, I will give children to define a width will automatically openCodePudding user response:
Your parent is not set high, wide to use child elements set up a wide high effect on the parent element, however your child element is only one display: inlinblockCodePudding user response:
Description is not clear, stick all of the code please, left: 100% drop is dryCodePudding user response:
In actual development, the width of the parent element is made up of the inside of the child elements open, but the absolute positioning child elements, by text structure from the parent element, so it is not open the parent element, not only hold does not open, but also by limiting the width of the parent element, therefore, don't use the positioning of the child element to open the parent element, this theory is wrong!CodePudding user response:
Can open<meta charset="utf-8"/& gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge, chrome=1"/& gt;
<style type="text/CSS" & gt;
The parent {
position: absolute;
Border - the radius: 0 px 0 5 px;
padding:10px;
Width: auto;
Min - height: 300 px;
Border: # 2 px solid DDD;
}
The children {
display: inline-block;
}
</style>
<body>
1343545685535554755757