Skip to content

Instantly share code, notes, and snippets.



Last active Jul 29, 2020
What would you like to do?
<!DOCTYPE html>
<title>CSS Quirks</title>
.clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
.clamp.two-lines {
-webkit-line-clamp: 2;
.clamp.three-lines {
-webkit-line-clamp: 3;
<body class="py-4">
<div class="max-w-lg mx-auto bg-gray-300 p-4">
<?php foreach (range(1, 10) as $i) : ?>
<div class="bg-white p-4 rounded mb-4">
<h1 class="font-bold mb-2 text-lg">A New Post</h1>
<p class="text-sm clamp three-lines">
<?php echo str_repeat('Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', $i) ?>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment