영어공부

CSS Dropdowns

2020. 1. 21. 11:46
목차
  1. Demo: Dropdown Examples
  2. Basic Dropdown
  3. Example Explained
  4. Dropdown Menu

Create a hoverable dropdown with CSS.

css 로 hoveable 한 dropdown을 만들어라.

 

Demo: Dropdown Examples

Move the mouse over the examples below:

 

아래 예제에 마우스를 옮겨라

 

Basic Dropdown

Create a dropdown box that appears when the user moves the mouse over an element.

 

기본적인 드롭다운

사용자가 요소 위에 마우스를 올릴때, 생겨지는 드롭다운을 만들어라.

 

 

Example Explained

HTML) Use any element to open the dropdown content, e.g. a <span>, or a <button> element.

Use a container element (like <div>) to create the dropdown content and add whatever you want inside of it.

Wrap a <div> element around the elements to position the dropdown content correctly with CSS.

 

CSS) The .dropdown class uses position:relative, which is needed when we want the dropdown content to be placed right below the dropdown button (using position:absolute).

The .dropdown-content class holds the actual dropdown content. It is hidden by default, and will be displayed on hover (see below). Note the min-width is set to 160px. Feel free to change this. Tip: If you want the width of the dropdown content to be as wide as the dropdown button, set the width to 100% (and overflow:auto to enable scroll on small screens).

Instead of using a border, we have used the CSS box-shadow property to make the dropdown menu look like a "card".

The :hover selector is used to show the dropdown menu when the user moves the mouse over the dropdown button.

 

예제를 설명 하자면,

html ) 버튼이나 <span>과 같이 내용을 드롭다운 하기 위한 요소를 사용하라.

드롭다운 내용물을 만들기 위해선, <div>와 같은 컨테이너 요소를 사용하라. 그리고 이것 안에 너가 원하는 것을 추가하라.

css로 명확하게 내용물을 포지션하기 위해서 div요소 주변에 요소를 감싸라?

 

css dropdown 클래스는 position:relative를 사용한다. 그것은 드롭다운 버튼 바로 아래에 드롭다운 내용물을 위치하는 것을 원할때, 필요료하다.

dropdown-content 클래스는 실제 드롭다운 내용물을 잡는다. 기본적으로는 감쳐져있지만, 이것은 마우스가 위에 있을때 보여진다. 최소넓이가 160px로 설정되어있음을 주의하라. 이것을 변경하는 것은 자유다. 

팁: 만일 드롭다운 내용물의 넓이가 드롭다운 버튼만큼 넓어지길 원한다면, width를 100%로 설정하라.

테두리를 사용하는 것 대신에, 우리는 CSS box-shadow 속성을 사용해왔다. 카드처럼 다롭다운을 만들기위해서

:hover 선택자는 사용자가 드롭다운 버튼에 마우스를 올렸을때, 드롭다운메뉴를 보여주기 위해 사용되었다.

 

Dropdown Menu

Create a dropdown menu that allows the user to choose an option from a list:

 

사용자가 리스트로부터 옵션을 선택하는 것을 허용하는 드롭다운 메뉴를 만들어라.

 

This example is similar to the previous one, except that we add links inside the dropdown box and style them to fit a styled dropdown button:

 

드롭다운 박스 안에 링크를 추가한것과 스타일된 드롭다운 버튼을 맞추기 위해 스타일링 한것 을 제외 하면 위의 예제와 비슷하다.

'영어공부' 카테고리의 다른 글

CSS Attribute Selectors  (0) 2020.01.21
CSS Image Sprites  (0) 2020.01.21
CSS Navigation Bar  (0) 2020.01.20
CSS Opacity / Transparency  (0) 2020.01.20
CSS Pseudo-elements  (0) 2020.01.20
  1. Demo: Dropdown Examples
  2. Basic Dropdown
  3. Example Explained
  4. Dropdown Menu
'영어공부' 카테고리의 다른 글
  • CSS Attribute Selectors
  • CSS Image Sprites
  • CSS Navigation Bar
  • CSS Opacity / Transparency
jeongsu
jeongsu
박정수가 공부한 자료를 남기기 위한 블로그
Park_jeong_su박정수가 공부한 자료를 남기기 위한 블로그
jeongsu
Park_jeong_su
jeongsu
전체
오늘
어제
  • 분류 전체보기 (255)
    • 제조산업 (11)
      • MES (8)
      • 반송 (0)
      • ERP (1)
    • dev (93)
      • 스프링 (2)
      • 데이터베이스 (20)
      • 프로그래밍 (6)
      • 알고리즘 (3)
      • Network (2)
      • trouble shooting (5)
      • 개인 프로젝트 (9)
      • 기타 (46)
    • 박정수 (85)
      • 자기소개 (1)
      • diary & 일상생활 (77)
      • 해외생활 - 중국편 (2)
      • 회고 (4)
    • 영어공부 (51)
    • 유용한 사이트 모음집 (13)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • java
  • mermaid js
  • MES 개발자를 하면 안되는 이유
  • Gin
  • 스마트팩토리 전망
  • MES 전망
  • MES 란
  • 배움의 목적
  • ERP
  • JPA
  • 어차피 뒤짐
  • w3cSchool
  • mes
  • coffee-bytes
  • MES 개발자
  • 비트코인
  • RMS란
  • MES 도망쳐
  • 회고
  • vscode
  • 본질이 존재할까?
  • MES의 어려움
  • recipe management system
  • MES란
  • 협업프로그램
  • oracle
  • MES 개발
  • tutorial
  • 에임시스템
  • spring

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.1.4
jeongsu
CSS Dropdowns
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.