#centerdiv {
position:fixed;
top: 40%;
left: 50%;
width:30em;
height:18em;
margin-top: -9em;
margin-left: -15em;
border: 1px solid #ccc;
background-color: #f3f3f3;
-moz-border-radius: 15px;
border-radius: 15px;
}
#errorcenterdiv {
position:fixed;
top: 40%;
left: 50%;
width:30em;
height:18em;
margin-top: -9em;
margin-left: -15em;
border: 1px solid #ccc;
background-color: #f3f3f3;
-moz-border-radius: 15px;
border-radius: 15px;
}
Can some one tell me WHY i can’t get this work on jquery i don’t know i start believe that there is something wrong with the css code that i don’t recognize .
if you are trying to add styles dynamically, use IDs to reference but classes to add the style. using IDs to append styles can have unexpected consequences (no styles applied)
so if you want a centered div
just reference via ID (centerMe), and add a class (centerDiv):
or
your css rule should have the “dot” (.) instead of “hash” (#)