DEV Community

Cover image for Windows XP Using HTML,CSS & JavaScript

Posted on • Updated on


Windows XP Using HTML,CSS & JavaScript

Hello, guys In this tutorial we will create Windows XP Error Message Using HTML, CSS & JavaScript

First, we need to create two files index.html and style.css then we need to do code for it.

Windows XP Step:1

<!DOCTYPE html>
  <meta charset="utf-8">
  <title>Windows XP Error Message</title>
  <link rel="stylesheet" type="text/css" href="style.css">
  <link href="" rel="stylesheet">
  <script src=""></script>
  <script src=""></script>
  <div class="error">
    <div class="title">
      Criticle Error
      <button class="close-button">X</button>
    <div class="message">
      <img src="error.png" alt="">An error has occurred while trying to display an error message.
    <button class="ok"><span>OK</span></button>

  <footer id="footer">
    <span class="start-btn">
      <img src="start-btn.png" alt="">
    <img src="win-bottom.png" alt="">
  <div class="start-menu-win">
    <img src="start-menu.png" alt="">


    var error = '<div class="error">' + $('.error').html() + '</div>',
    x = window.innerWidth / 3.
    y = window.innerHeight / 3;

    $('body').on('click', '.ok', '.close-button', function(){
      $('.error').last().css({ top: y + 'px', left: x + 'px'}).draggable();


Enter fullscreen mode Exit fullscreen mode

Windows XP Step:2

Then we need to add code for style.css which code I provide in the below screen.

  padding: 0;
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
html, body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
  background: url(windows-xp.jpg) no-repeat center/cover;
  overflow: hidden;
footer#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
footer#footer img {
  width: 100%;
  display: block;
  margin: 0;
span.start-btn {
  position: absolute;
  left: 0;
  width: 100%;
  max-width: calc(100% - 95vw);
  cursor: pointer;
.error {
  position: absolute;
  width: 494px;
  height: 142px;
  padding: 2px;
  background-color: #e8e8d8;
  border: 1px outset #dedede;
  cursor: move;
  animation: display 0.2s;
  animation-fill-mode: forwards;
.title {
  position: relative;
  width: 100%;
  height: 30px;
  margin: 0 auto;
  color: #fff;
  text-shadow: 0 0 #fff;
  line-height: 30px;
  background-image: linear-gradient(left, #0050e0, #3890f8);
  background-image: -webkit-linear-gradient(left, #0050e0, #3890f8);
button.close-button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 25px;
  height: 25px;
  color: #000;
  text-align: center;
  font-weight: bold;
  background: #e8e8d8;
.message {
  width: 100%;
  margin-top: 25px;
  margin-left: 10px;
  font-family: Arial, sans-serif;
  font-size: 14px;
.message img {
  float: left;
  margin-top: -15px;
  margin-right: 20px;
button.ok {
  position: absolute;
  width: 100px;
  height: 27px;
  background: #e8e8d8;
  border: 1px solid #2d2d2d;
  box-shadow: inset -1px -1px 2px rgb(0 0 0 / 70%);
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
.start-menu-win {
  position: fixed;
  bottom: 18px;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
} {
  opacity: 1;
Enter fullscreen mode Exit fullscreen mode

Windows XP Video Output:

Some JavaScript Tutorial

Best Animation Examples 2020

EYE Animation JavaScript

How to find a word in a paragraph

Top comments (3)

vasilisplavos profile image
Vasilis Plavos

we want the blue screen of death

stackfindover profile image

I will try to do this

__manucodes profile image

Reminds me of geekprank:

Fun trick to play on friends ;)