Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <!-- Place the following CSS in your <head> or stylesheet --> <style> /* This is an optional body style to provide a background for the page */ body { background-color: #f3f4f6; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; } /* Optional: a container to center the card on the page for demonstration */ .demo-container-tweet { display: flex; justify-content: center; padding: 2rem; } /* === Tweet Card Styles === */ .tweet-card { --tweet-radius: 12px; --tweet-shadow: 0 4px 10px rgba(0,0,0,0.06); background-color: #ffffff; border-radius: var(--tweet-radius); box-shadow: var(--tweet-shadow); max-width: 550px; width: 100%; padding: 1.25rem; border: 1px solid #e5e7eb; } .tweet-header { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; } .tweet-avatar { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; } .tweet-author-info { line-height: 1.3; } .tweet-author-name { font-weight: 600; color: #111827; } .tweet-author-handle { color: #6b7280; } /* Tweet content */ .tweet-content { font-size: 1rem; line-height: 1.6; color: #1f2937; margin: 0 0 1rem 0; } /* Optional image preview */ .tweet-image-container { display: block; margin: 1rem 0; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; } .tweet-image { width: 100%; height: auto; display: block; } /* Timestamp */ .tweet-timestamp { display: block; font-size: 0.875rem; color: #6b7280; padding: 1rem 0; border-top: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; margin: 1rem 0; } .tweet-timestamp a { color: inherit; text-decoration: none; } .tweet-timestamp a:hover { text-decoration: underline; } /* Action bar */ .tweet-actions { display: flex; justify-content: space-around; align-items: center; } .tweet-action-btn { display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: none; padding: 0; cursor: pointer; font-size: 0.875rem; color: #6b7280; transition: color 0.2s ease; } .tweet-action-btn svg { width: 20px; height: 20px; } /* Hover colors for actions */ .tweet-action-btn.action-reply:hover { color: #3b82f6; } .tweet-action-btn.action-retweet:hover { color: #16a34a; } .tweet-action-btn.action-like:hover { color: #ef4444; } </style> <!-- Place the following HTML in your <body> --> <div class="demo-container-tweet"> <article class="tweet-card" aria-label="Tweet"> <header class="tweet-header"> <img src="https://placehold.co/96x96/7dd3fc/ffffff/png?text=CR" class="tweet-avatar" alt="Avatar of Caspian Reed"> <div class="tweet-author-info"> <span class="tweet-author-name">Caspian Reed</span> <span class="tweet-author-handle">@caspian_dev</span> </div> </header> <p class="tweet-content"> Working with CSS custom properties (variables) has completely changed my workflow. The ability to theme an entire application just by changing a few values is a game-changer. Highly underrated for large-scale projects. </p> <a href="#" class="tweet-image-container"> <img src="https://placehold.co/1100x600/a78bfa/ffffff/png?text=Code+Snippet" class="tweet-image" alt="An example code snippet demonstrating CSS custom properties."> </a> <div class="tweet-timestamp"> <a href="#"><time datetime="2025-10-22T09:15:00Z">9:15 AM • Oct 22, 2025</time></a> </div> <footer class="tweet-actions"> <button type="button" class="tweet-action-btn action-reply"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z"></path></svg> 12 </button> <button type="button" class="tweet-action-btn action-retweet"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4.5 3.88l4.432 4.14-1.364 1.46L5.5 7.55V16c0 1.1.896 2 2 2H13v2H7.5c-2.209 0-4-1.79-4-4V7.55L1.432 9.48.068 8.02 4.5 3.88zM16.5 6H11V4h5.5c2.209 0 4 1.79 4 4v8.45l2.068-1.93 1.364 1.46-4.432 4.14-4.432-4.14 1.364-1.46 2.068 1.93V8c0-1.1-.896-2-2-2z"></path></svg> 54 </button> <button type="button" class="tweet-action-btn action-like"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M16.697 5.5c-1.222-.06-2.679.51-3.89 2.16l-.805 1.09-.806-1.09C9.984 6.01 8.526 5.44 7.304 5.5c-1.243.07-2.349.78-2.91 1.91-.552 1.12-.633 2.78.479 4.82 1.074 1.97 3.257 4.27 7.129 6.61 3.87-2.34 6.052-4.64 7.126-6.61 1.111-2.04 1.03-3.7.477-4.82-.561-1.13-1.666-1.84-2.908-1.91zm4.187 7.69c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"></path></svg> 1.2k </button> <button type="button" class="tweet-action-btn action-views"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.75 21V3h2v18h-2zM18 21V8.5h2V21h-2zM4 21l.004-10h2L6 21H4zm9.248 0v-7h2v7h-2z"></path></svg> 28k </button> </footer> </article> </div>