<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .out { width: 500px; height: 300px; background: red; display: flex; justify-content: center; align-items: center; margin: 0 auto; } .out .in { width: 100px; height: 100px; background: white; } </style> </head> <body> <div class="out"> <div class="in"> </div> </div> history.pushState({ title: attrs.title }, attrs.title, urlStr); history.pushState({ title: document.title }, document.title, urlStr); </body> </html>