значения свойства:
* {
margin
:
0
;
padding
}
.a {
height
400px
width
position
absolute
top
50%
left
margin-top
-200px
margin-left
border
1px
solid
#808080
#div
1
, .b, .c {
100px
background-color
#7092BE
{
150px
.c {
bottom
25px
fixed
* { margin: 0; padding: 0; } .a { height: 400px; width: 400px; position: absolute; top: 50%; left: 50%; margin-top: -200px; margin-left: -200px; border: 1px solid #808080; } #div1, .b, .c { width: 100px; height: 100px; background-color: #7092BE; } #div1 { top: 150px; left: 150px; } .c { bottom: 25px; left: 25px; position: fixed; }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
type
"text/javascript"
src
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></
</
body
div
class
"a"
id
"div1"
"b"
"c"
/*JavaScript*/
document.getElementById("div1").style.position = "relative";
/*jQuery*/
$(document).ready(function () {
$(".b").css({ "position": "static" });
});