🔒 Closed Notification Text Message [Pasok CSS GOD]

Status
Not open for further replies.

James_Mikes

Honorary Poster
Hi mga ka PHC ask ko lang kung baka may naitabi kayong ganitong design basically ganito gusto ko mangyari

1. pag load nang page
2. lalabas yang parang message box sa baba nang button kasama yang parang arrow pure css sana kung pwede


pagaaralan ko lang pano ginawa 6 hours na akong nag try hindi talaga kaya nang powers

1694423380677.png



Additional:
Kung pwede one time lang siya lalabas
 
Hello!

Sure, I can help you with that. You can achieve the desired effect using pure CSS. Here's an example of how you can implement a message box that appears when the page loads:

HTML:
HTML:
<div class="message-box">
  <button class="close-btn">&times;</button>
  <p>This is a message.</p>
</div>

CSS:
CSS:
.message-box {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  display: none;
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

.message-box p {
  margin: 0;
}

.message-box.show {
  display: block;
}

JavaScript:
JavaScript:
window.addEventListener('DOMContentLoaded', (event) => {
  const messageBox = document.querySelector('.message-box');
  const closeBtn = messageBox.querySelector('.close-btn');
  
  closeBtn.addEventListener('click', () => {
    messageBox.classList.remove('show');
  });
  
  messageBox.classList.add('show');
});

In this example, the message box is hidden by default (display: none). When the page loads, the JavaScript code adds the show class to the message box element, which makes it visible (display: block). Clicking the close button will remove the show class, hiding the message box again.

Feel free to customize the CSS to match your design requirements. Let me know if you have any further questions!
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 496
    Views
  • 3
    Participants
Last reply from:
Xirvana

Online now

Members online
1,148
Guests online
5,182
Total visitors
6,330

Forum statistics

Threads
2,349,994
Posts
29,365,531
Members
1,089,446
Latest member
yanrr
Back
Top