hi
how to put div at the center of page
I want div id="Backheader" to be at the center of the page and when I scroll down it will fix the top to the page
here before I define position:fixed;
div was at the center of page but when I add position:fixed; it went to the left side of the page
I want it be at the center.
I define <div > in page :
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="Css/bootstrap.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="Scripts/bootstrap.min.js"></script>
<style type="text/css">
#BackHeader {
width: 1349px;
background-color: #212121;
height: 50px;
color: white;
position: relative !important;
top: 0 !important;
right: 0 !important;
left: 0 !important;
z-index: 1030 !important;
}
.fix1 {
width:1000px;
height:2000px;
border:1px solid red;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="d-sm-inline">
<div class="row justify-content-center text-center">
<div id="BackHeader" class="col-auto">
Back Header
</div>
<div class="fix1"></div>
</div>
</div>
</div>
</form>
</body>
</html>
Best regards
Neda