div
{
    width: 200px;
    height: 200px;
    overflow: hidden;
    position: relative;
}
img {
    position:absolute;
    left: -100%;
    right: -100%;
    top: -100%;
    bottom: -100%;
    margin: auto; 
    min-height: 100%;
    min-width: 100%;
}

http://stackoverflow.com/questions/18673900/how-to-center-and-crop-an-image-to-square-with-css

http://stackoverflow.com/questions/11552380/how-to-automatically-crop-and-center-an-image

white-space: pre;

ios에서 css속성에 overflow: scroll를 주면 스크롤시 부드럽지 못하고 뚝뚝 끊기는 현상이 있다.

이를 자연스럽게 하기 위해서 아래 속성을 추가하면 된다.


-webkit-overflow-scrolling: touch;


calc함수를 사용하면 css상에서 연산이 가능하다.


javascript단에서 연산해서 적용하는 수고를 덜어준다.


사용법은 간단하다.


width: calc(100%/3);


이런식으로 나누기 연산이 가능하며


width: calc(100%/3 - 20px);


이렇게 하면 3을 나눈후 20px를 빼준다.

@media all and (orientation:portrait) {...} //세로모드, 뷰포트 높이가 너비에 비해 상대적으로 크면 실행


@media all and (orientation:landscape) {...} //가로모드, 뷰퍼트 너비가 높이에 비해 상대적으로 크면 실행

http://css-tricks.com/examples/ShapesOfCSS/


별모양, 오각형, 평행사변형 등 다향한 도형을 css로 표현



http://leaverou.github.io/prefixfree/


-moz-  -webkit-같은 prefix를 생략하게 해줍니다.


'hybrid app > css3' 카테고리의 다른 글

[css3] Increase Your Site’s Performance with Hardware-Accelerated CSS  (0) 2013.12.13
[css3] 도형 정리 사이트  (0) 2013.08.28
[css3] +, ~ 선택자(selector)  (0) 2013.08.27
[css3] box-sizing  (0) 2013.08.20
[css3] max-width  (0) 2013.08.20

+ Recent posts