#sampleDiv { width: 300px; height: 200px; text-align: center; line-height: 200px; background: green; position: fixed; top: 0px; right: 0px; bottom: 0px; left: 0px; margin: auto; }