CalifLRev Posted May 3, 2023 Share Posted May 3, 2023 @tuanphan, if a category was to overflow into a second line, would it be possible to automatically create a line break that sends the entire category to the second line? For instance, "Freedman" in the image below automatically overflows into the second line because there's no more space. Is it possible for the full category, "Eli Freedman," to all go on the second line, and not just half of the category? Link to comment
Solution CalifLRev Posted May 4, 2023 Author Solution Share Posted May 4, 2023 Here's how it's done: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function() { $('.blog-categories').each(function() { // select all elements with class "categories" and loop through them $(this).html($(this).html().replace(/\s/g,' ')); // replace all white spaces with nbsp }); }); </script> <script> $(document).ready(function() { $('.summary-metadata-item--cats a').each(function() { // select all elements with class "categories" and loop through them $(this).html($(this).html().replace(/\s/g,' ')); // replace all white spaces with nbsp }); }); </script> tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment