phdphd Posted March 26, 2018 Share Posted March 26, 2018 Hi All, Sorry if the title is not explicit enough. I have made a fiddle about my issue. http://jsfiddle.net/pggkfdkw/1/ I would like to adjust the div width (red rectangle) to its contents, while still keeping the text centered. Thanks ! Link to comment Share on other sites More sharing options...
requinix Posted March 27, 2018 Share Posted March 27, 2018 DIVs are block elements by default and will expand their widths to their containers automatically. Give the text centering to its container and make the DIV be either inline or inline-block. Link to comment Share on other sites More sharing options...
phdphd Posted March 27, 2018 Author Share Posted March 27, 2018 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.