html - How can I get a div to be minimum width when it's inside another div? -
i have 2 divs.
div 100% width
div b inside of div a, has no width set , has few words of text inside it
i tried set bottom border div b text appeared underline. seems div b extends full width of div a. there way can make div b width of text.
hope problem clear.
thanks,
divs block level elements, means expand 100% of width of container.
if you're looking put border around text, wrap in inline element such span , apply border span.
alternatively, use display:inline
on div in question, there's no point using div purpose
Comments
Post a Comment