CSS Diner

이경민·2022년 8월 26일
0

css diner 주소

https://flukeout.github.io/#

  1. select the plates
    plate

  2. select the bento boxes
    bento

  3. select the fancy plate
    #fancy

  4. select the apple on the plate
    plate apple

  5. select the pickle on the fancy plate
    #fancy pickle

  6. Select the small apples
    .small

  7. Select the small oranges
    orange.small

  8. Select the small oranges in the bentos
    bento orange.small

  9. Select all the plates and bentos
    plate, bento

  10. Select all the things!
    *

  11. Select everything on a plate
    plate * => 띄어쓰기 중요함

  12. Select every apple that's next to a plate
    plate + apple

  13. Select the pickles beside the bento
    bento ~ pickle

  14. Select the apple directly on a plate
    plate>apple

  15. Select the top orange
    plate :first-child

  16. Select the apple and the pickle on the plates
    plate :only-child

  17. Select the small apple and the pickle
    :last-child.small

  18. Select the 3rd plate
    :nth-child(3)

  19. Select the 1st bento
    bento:nth-last-child(3)

  20. Select first apple
    apple:first-of-type

  21. Select all even plates
    :nth-of-type(even)

  22. Select every 2nd plate, starting from the 3rd
    :nth-of-type(2n+3)

  23. Select the apple on the middle plate
    :only-of-type.small

  24. Select the last apple and orange
    :last-of-type.small

  25. Select the empty bentos
    bento:empty

  26. Select the big apples
    apple:not(.small)
    :not(.small,plate)
    두가지 다 답이 가능함.

  27. Select the items for someone
    [for]

  28. Select the plates for someone
    plate[for]

  29. Select Vitaly's meal
    [for="Vitaly"] => 첫글자 소문자X. 문자열로 받으니까 문자열이 전부 맞아야 함.

  30. Select the items for names that start with 'Sa'
    [for^="Sa"] => 마찬가지로 첫글자 대문자.

  31. Select the items for names that end with 'ato'
    [for$="ato"]

  32. Select the meals for names that contain 'obb'
    [for*="obb"]

참고!

이건 비단 CSS에서만 적용되는 문법이 아니니까 외워두면 좋다!
^ : 시작을 나타냄
$ : 끝을 나타냄
* : 전체를 나타냄

0개의 댓글

Powered by GraphCDN, the GraphQL CDN