[#1281] Fix horizontal alignment issues.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/commit/8f5c1496 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/tree/8f5c1496 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/diff/8f5c1496 Branch: refs/heads/master Commit: 8f5c1496a4cd05cb420ff9e9c76f6fa35d014106 Parents: 1479de0 Author: Michael Brooks <mich...@michaelbrooks.ca> Authored: Mon Aug 27 17:32:56 2012 -0700 Committer: Michael Brooks <mich...@michaelbrooks.ca> Committed: Mon Aug 27 17:32:56 2012 -0700 ---------------------------------------------------------------------- www/css/index.css | 26 +++++++++++++------------- www/img/logo.png | Bin 19932 -> 21814 bytes 2 files changed, 13 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/blob/8f5c1496/www/css/index.css ---------------------------------------------------------------------- diff --git a/www/css/index.css b/www/css/index.css index 8caabd1..6986641 100644 --- a/www/css/index.css +++ b/www/css/index.css @@ -42,27 +42,27 @@ body { text-transform:uppercase; } -/* portrait layout for the app (default) */ +/* Portrait layout (default) */ .app { - background:url(../img/logo.png) no-repeat; - position:absolute; + background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ + position:absolute; /* position in the center of the screen */ left:50%; top:50%; - margin:-120px 0 0 -110px; /* shift container to top-left by half its width and height */ - background-position:center top; - height:100px; /* add enough room for text */ - padding:180px 0px 0px 0px; /* background-image height - image's shadow */ + height:50px; /* text area height */ + width:225px; /* text area width */ text-align:center; + padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ + margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ + /* offset horizontal: half of text area width */ } -/* lanscape layout for the app (when wide enough) */ -@media screen and (min-aspect-ratio: 1/1) and (min-width:445px) { +/* Landscape layout (with min-width) */ +@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { .app { background-position:left center; - height:140px; /* height + padding = background image size */ - padding-left:170px; /* background width */ - padding-top:60px; /* vertically center the text to background image */ - margin:-90px 0 0 -200px; /* shift container to top left by half its width and height */ + padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ + margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ + /* offset horizontal: half of image width and text area width */ } } http://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world/blob/8f5c1496/www/img/logo.png ---------------------------------------------------------------------- diff --git a/www/img/logo.png b/www/img/logo.png index e8169cf..9519e7d 100644 Binary files a/www/img/logo.png and b/www/img/logo.png differ