tags:

views:

65

answers:

5

Is it possible?

A: 

Not in HTML, but in JavaScript.

window.screen has width and height properties.

David Hedlund
+3  A: 

You can do this with javascript using window.screen. See here.

Jon B
+1  A: 

no. but you can create layouts that depends not on pixels or cm, but percentages. they are called liquid layouts. also you can define a minimun width or height to be sure your layout won't broke in minnor screens.

other alternatives includes client side scripting (like javascript) as already said by the others.

hugo_leonardo
+1  A: 

Just in case you're asking to center something onto the screen/browser window:

Use CSS:

.cen {
  margin: auto;
}

and in case it is a picture you want to center:

.cen {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -<witdh of image>/2;
  margin-top: -<height of image>/2;
}
polemon
+1  A: 

Another great way to do this is using @media queries.

A brief overview can be found here; http://www.css3.info/preview/media-queries/

Or a more thorough explanation from the W3C; http://www.w3.org/TR/css3-mediaqueries/

This may not be the best option if you're worried about a lack of support on older browsers, but if you're not, this is the best way to go!

Josiah Sprague