Is It Possible To Extend A H2 Box In Css Depending On The Text Within It? July 28, 2023 Post a Comment I have a header box appearing on a page. I am using h2 and configured this to show a border etc. My issue is that the longest text requires a box of 400px wide, whereas the shortesSolution 1: Try thisdiv{ float: left; width: auto; background-color: #777; } CopyDEMO Solution 2: yes you can apply float: left to H2Baca JugaOverride Images From Getting Height+width From Css, Html Attribute InsteadCaption Does Not Work After Centering ImageHow To Align Pseudo Element :before :after And Span Element Share You may like these postsAccordion Scroll Issue - Scroll To Top Of Active AccordionSelect2 Doesn't Render ProperlyAre There Selectors That Target Elements In Certain Grid Positions?Changing Pin Colour For Active Item On Static Map Post a Comment for "Is It Possible To Extend A H2 Box In Css Depending On The Text Within It?"
Post a Comment for "Is It Possible To Extend A H2 Box In Css Depending On The Text Within It?"