Why is my width 100%?

http://geodit.com:8000/d/4

If you go to this site, you will see that $ ("# coreimage") is set to the width: auto.

However, for some reason, it does not support the width of the cheerios window (instead, it is 100% ...)

+3
source share
2 answers

coreimageis that divwhich is a block element. Block elements by default accept the full available width unless you explicitly set the width (to a value other than auto) or the floatelement.

I'm not sure what you want the end result to be, but you can either change the element to an inline element (i.e. span), or point float: leftto your element.

+3
source

, . , #coreimage ? . div ( ) , , , (.. Span) (.. , )

+1

Source: https://habr.com/ru/post/1782866/


All Articles