<style> /* Show only 2 lines in smaller screens */ .readmore { max-height: 3em; /* (2 * 1.5 = 3) */ } /* Show 4 lines on larger screens */ @media screen and (min-width: 640px) { .readmore { max-height: 6em; } } <style>