반응형
반응형

iPad CSS Layout with landscape / portrait orientation modes

http://matthewjamestaylor.com/blog/ipa ··· it-modes
Free iPad CSS layout with landscape/portrait orientation modes

The iPad has finally launched in Australia today, hooray! I will probably get one soon so I can continue to optimise my CSS layouts for as many devices as possible. But in the mean-time I will continue using the iPad emulator that comes with the iPhone SDK.

To celebrate the launch of the iPad I have built a special iPad optimised website layout that uses pure CSS to change layouts in the portrait and landscape orientation modes. The layout can be downloaded for free at the bottom of this article or from my iPad demo page. Here is a basic diagram of how the two orientations look:

iPad CSS layout portrait / landscape designs

In Landscape mode the layout is in two columns. The main content is in a wide left column and three side sections are stacked vertically in a narrow right column. When you rotate the iPad to the portrait orientation the layout changes to a single column design. In portrait mode the main content fills the full width of the screen and the three side content areas are positioned horizontally as three columns under the main content.

In both orientations there is a header at the top and a footer at the bottom. These both change in width from 1024 pixels wide in landscape, and 768 pixels wide in portrait. See my demo page for a more detailed diagram with pixel dimensions. Below are screenshots of my demo layout in the iPad emulator:

iPad CSS layout in the iPad emulator

How does it work?

The first thing I do is lock the layout's resolution to a 1:1 ratio so that each pixel exactly lines up with the pixels in the iPad's screen. I do this with the following META tag:

<meta name="viewport" content="width=768px, minimum-scale=1.0, maximum-scale=1.0" />

Locking the layout to a 1:1 ratio will prevent the zooming-in and out that normally occurs when the iPad is rotated (normally, landscape mode is more zoomed-in because the width of the webpage is displayed across 1024 pixels, as opposed to portrait mode when there are only 768 pixels available).

Next I combine this with some CSS rules that change the layout in portrait and landscape modes. I do this by writing all my landscape styles normally then overwriting some of them with the @media rule at the bottom of the CSS file when the device is in portrait mode. Here is a cut-down version of the CSS:

/*normal styles here */
#wrap {
width:1024px;
}
@media only screen and (orientation:portrait){
/* portrait styles here */
#wrap {
width:768px;
}
}

The method above works beautifully for changing the layout for the two orientations without JavaScript. Check out my iPad layout demo or download the demo files and try it for yourself.


Demo Download (ipad-css-layout.zip - 41kb)


I hope you enjoyed this post. If you are reading this on your brand new iPad then... lucky you! :)

 

반응형

'프로그래밍 > Architect' 카테고리의 다른 글

[Chrome] remote - Debugging  (0) 2015.09.22
엑셀 하이퍼링크 함수  (0) 2015.09.01
모바일 기획  (0) 2015.08.14
아이패드 , 윈도우와 Airplay 하기.  (0) 2015.04.27
개발 명장이 되는 길  (0) 2014.10.10
반응형

[javascript] hash 에서 파라미터 정보 가져오기



 

 

 

 

 

 



반응형
반응형

모바일 서비스 기획하기


좋은 디자이너, 나쁜 프로젝트매니저, 이상한 개발자
















반응형
반응형

http://www.bloter.net/archives/234334 

 

<데브포스트>는 160개의 해커톤 1만여개의 프로젝트, 1만3281명의 해커에게 그들이 해커톤에서 사용한 기술을 물었다. 이를 기반으로 기술, 언어, API 인기 순위가 담긴 ‘학생 해커 리포트‘도 공개했다. 해커톤 프로젝트에서 해당 언어, 기술이 얼마나 많이 태그 됐는지에 따라 순위가 집계됐다.

다음 순위들은 학생 해커톤에서 집계된 것이므로 몇 가지 유의할 점이 있다. 해커톤은 보통 24~48시간처럼 짧은 시간 안에 개발을 진행해야 한다. 그래서 API를 이용한 웹, 모바일 앱 개발이 주를 이룬다. 자원도 한정돼 있기에 무료 혹은 비용이 적은 기술을 사용하게 된다. 이 순위들은 실제 IT업계에서 쓰는 비중과는 차이가 날 수 있다.

기술 & API 순위

모바일 플랫폼

플랫폼 %
Android 38.2
iOS 22.7
Windows Phone 4.9

프로그래밍 언어

1 HTML/CSS 11 Ruby
2 JavaScript 12 XML
3 Python 13 Ajax
4 Java 14 Shell
5 C/C++ 15 Processing
6 PHP 16 Lua
7 Objective-C 17 CoffeeScript
8 C# 18 Go
9 Swift 19 MATLAB
10 JSON 20 OpenGL

*HTML은 프로그래밍 언어가 아니라 마크업 언어다. 하지만 거의 모든 웹 개발에서 쓰이기 때문에 포함됐다. 제이슨도 프로그래밍 언어가 아니지만 포함됐다.

스위프트는 출시된 지 13개월 밖에 안 됐지만 9위에 올랐다.

데이터베이스

1 MongoDB
2 MySQL
3 SQLite
4 PostgreSQL
5 FoundationDB

커뮤니케이션 API

1 Twilio
2 Yo
3 SendGrid
4 Moxtra
5 Mailjet

소셜 API

1 Facebook
2 Twitter
3 Reddit
4 Instagram
5 Google+

결제, 금융 API

1 Venmo
2 Paypal
3 Stripe
4 Braintree
5 Blockchain

벤모 API가 페이팔보다 더 많이 쓰였다.

 

 

반응형
반응형
[엑셀] 셀 세로/가로 선택 후 내용 복사.

 

 

1. 복사할 셀 첫 열의 셀 선택하고 싶은 끝까지 선택하기.

  :   Ctrl + Shift + End

 

2. 동일한 내용을 선택된 셀에 복사하기

 : Ctrl + D

 

 

반응형
반응형

윈도우 최대절전모드 끄기



어느날 부터인가 컴퓨터가 대기모드로 들어가서 꺼진다.


아무 설정하지 않았는데.  컴퓨터 전원관리에서 변경해도 꺼진다.


그럴때, 최대절전모드 끄기 명령어 실행.


[윈도우] - [검색] : CMD 검색.


관리자 권한으로 실행해야 한다.


그리고, 명령어 창에 " powercfg -h off  " 라고 입력하면 끝!


명령어창 닫는 명령은  " exit "





 

* 배치파일(.bat)을 항상 관리자권한으로 실행하기

  1. 배치파일의 바로가기를 만든다.

  2. 바로가기 속성에서 "고급(D)..." 선택

  3. 관리자 권한으로 실행 을 체크한다.

  4. 시작프로그램 폴더에 바로가기를 넣어두면 부팅시 항상 실행.

 

 

 

.

반응형

'프로그래밍 > Server' 카테고리의 다른 글

윈도우 호스트(hosts) 파일 변경하기  (0) 2015.10.07
OpenSSL Convert PEM  (0) 2015.09.08
[Linux] Install Ubuntu 13.10  (0) 2013.12.23
[Linux] How To Dual Boot OS X and Linux  (0) 2013.12.23
[CMD] Window Console: conemu-maximus5  (0) 2013.06.28

+ Recent posts