Así que escribí un código que constaba de CSS y javascript y luego usé html para llamarlos. Así es como se veía el código:
<!doctype html> <html ⚡ lang="en"> <head> <meta charset="utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script async src="http://localhost/stemideas.org/duid.js"></script> <link rel="shortcut icon" type="image/x-icon" href="https://ivanhoesuites.com/wp-content/uploads/2021/12/favicon-32x32-1.png"> <title>Provider Judi Tembak Ikan Indonesia Terpercaya</title> <meta name="description" content="Judi Tembak Ikan · Demo tembak ikan · Game Tembak Ikan · Mainkan game ini bersama agen judi tembak ikan terpercaya! "> <style type="text/css"> #perSecond { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 50px; font-weight: bold; font-family: sans-serif; color:white; background-color: black; } </style> <script> window.onload = function() { startDate("May 01, 2017 00:00:00 EST"); }; function startDate(x) { rightNow = new Date(); x = new Date(x); difference = rightNow - x; amtPerSecond = (41.70 * (difference / 1000)).formatMoney(2); $("#perSecond").text("Rp." + amtPerSecond); clearTimeout(startDate.to); startDate.to = setTimeout(function() { startDate(x); }, 1000); } // Plug-in to combact safari's incompatibility with .toLocaleString() Number.prototype.formatMoney = function(c, d, t) { var n = this, c = isNaN((c = Math.abs(c))) ? 2 : c, d = d == undefined ? "." : d, t = t == undefined ? "," : t, s = n < 0 ? "-" : "", i = String(parseInt((n = Math.abs(Number(n) || 0).toFixed(c)))), j = (j = i.length) > 3 ? j % 3 : 0; return ( s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "") ); }; </script> <body> <div id="perSecond"></div> <html>Funciona según lo previsto, sin embargo, estoy tratando de crear algo más o menos parecido a esto: https://i.stack.imgur.com/dsdZq.png
¿Cómo agrego dicho rectángulo/marco al javascript? ¡gracias amigos!
parece que solo necesitas envolver el
<div id="perSecond"></div>en otro div y comience a aplicar su css o si lo tiene como imagen, puede usar backgroundimage css y agregarlo a su
#perSecond {} css tag