<form style="width: 300px; margin: 100px">
  <input type="text" placeholder="placeholder" />
  <button type="reset">&times;</button>
</form>
form {
  display: flex;
  position: relative;

  input {
    width: 100%;
    outline: none;
  }

  button[type="reset"] {
    position: absolute;
    border: 0;
    right: 0;
    outline: none;
    background: transparent;
  }

  input:not(:placeholder-shown) ~ button[type="reset"] {
    display: block;
  }

  input:placeholder-shown ~ button[type="reset"] {
    display: none;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.