WEBLEB
Startseite
Editor
Anmelden
Pro
Deutsch
English
Français
Español
Português
Deutsch
Italiano
हिंदी
Facebook-UI-Mockup – HTML-Beispiel
45
denielkim237
Im Editor öffnen
Veröffentlichen Sie Ihren Code
Empfohlen
18 September 2025
Text-zu-Blumen-Generator – Animierte Buchstabenkunst
18 April 2025
Dawid Wróbel – Full-Stack-Entwickler-Portfolio
25 March 2025
Wheel Timeline – reines CSS
HTML
Copy
Facebook Mockup
f
Home
Watch
Marketplace
Groups
Profile
Your Story
Friend 1
Friend 2
Post
John Doe
Hello world! This is a sample post.
Like
Comment
Share
Jane Smith
Just had coffee! ☕
Like
Comment
Share
CSS
Copy
body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f0f2f5; } .header { display: flex; align-items: center; background-color: #1877f2; color: white; padding: 10px 20px; justify-content: space-between; } .logo { font-size: 2em; font-weight: bold; background: white; color: #1877f2; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; } .search-bar input { width: 300px; padding: 10px; border: none; border-radius: 20px; } .nav-icons span { margin-left: 20px; cursor: pointer; } .sidebar { position: fixed; left: 0; top: 70px; width: 200px; height: calc(100vh - 70px); background: white; padding: 20px; } .story { background: #f0f2f5; margin: 10px 0; padding: 10px; border-radius: 10px; text-align: center; } .main-feed { margin-left: 220px; margin-top: 20px; padding: 20px; } .create-post textarea { width: 100%; height: 80px; border: none; border-radius: 20px; padding: 15px; margin-bottom: 10px; resize: none; } .create-post button { background: #1877f2; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; } .post { background: white; margin: 20px 0; padding: 15px; border-radius: 10px; } .post-header { display: flex; align-items: center; margin-bottom: 10px; } .post-header img { border-radius: 50%; margin-right: 10px; } .post-actions button { background: none; border: none; margin-right: 15px; cursor: pointer; color: #65676b; }
JS
Copy
// Simple like button functionality (for demo) document.querySelectorAll('.post-actions button').forEach((button, index) => { if (button.textContent === 'Like') { button.addEventListener('click', () => { button.textContent = 'Liked'; button.style.color = '#1877f2'; setTimeout(() => { button.textContent = 'Like'; button.style.color = '#65676b'; }, 2000); }); } }); // Post creation (basic alert for demo) document.querySelector('.create-post button').addEventListener('click', () => { const textarea = document.querySelector('.create-post textarea'); if (textarea.value.trim()) { alert('Post created: ' + textarea.value); textarea.value = ''; } });