Div ain’t workin

ain’t working idk why but i need help

Hey @ChaseClift welcome to the forums.

Can you please elaborate on your problem and share your code or a link to your repl?

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>replit</title>
  <link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
 <center<div class="w3-light-grey">
  <div id="myBar" class="myDiv" style="width:20%">20%</div>
j<br>
<button class="w3-button w3-green" onload="move()">Load</button> 

</div>
 </center>
  
<script>
function move() {
  var elem = document.getElementById("myBar");   
  var width = 20;
  var id = setInterval(frame, 10);
  function frame() {
    if (width >= 100) {
      clearInterval(id);
    } else {
      width++; 
      elem.style.width = width + '%'; 
      elem.innerHTML = width * 1  + '%';
    }
  }
}
</script>

</body>
</html> 

</html>

  <script src="script.js"></script>

 <!--
  This script places a badge on your repl's full-browser view back to your repl's cover
  page. Try various colors for the theme: dark, light, red, orange, yellow, lime, green,
  teal, blue, blurple, magenta, pink!
  -->
 <!-- <script src="https://replit.com/public/js/replit-badge.js" theme="blue" defer></script> -->
</body>

</html>

I think because the opening center tag does not have > at the end of it. Also, the center tag has been deprecated and may not be supported in all broswers

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.