전역 CSS 설정, 확장 가능한 클래스로 스타일을 지정하고 강화한 기본 HTML 요소, 고급 그리드 시스템.
개요
더 우수하고 빠르며 강력한 웹 개발에 대한 접근 방식을 포함하여 Bootstrap 인프라의 주요 부분에 대한 정보를 얻으십시오.
HTML5 문서 유형
부트스트랩은 HTML5 doctype을 사용해야 하는 특정 HTML 요소와 CSS 속성을 사용합니다. 모든 프로젝트의 시작 부분에 포함하십시오.
모바일 퍼스트
Bootstrap 2에서는 프레임워크의 주요 측면에 대한 선택적 모바일 친화적 스타일을 추가했습니다. Bootstrap 3를 사용하여 처음부터 모바일 친화적으로 프로젝트를 다시 작성했습니다. 선택적 모바일 스타일을 추가하는 대신 핵심에 바로 구워집니다. 사실 부트스트랩은 모바일 우선 입니다. 모바일 퍼스트 스타일은 별도의 파일이 아닌 전체 라이브러리에서 찾을 수 있습니다.
적절한 렌더링 및 터치 확대/축소를 보장하려면 뷰포트 메타 태그 를 <head>.
user-scalable=no뷰포트 메타 태그 에 추가하여 모바일 장치에서 확대/축소 기능을 비활성화할 수 있습니다 . 이렇게 하면 확대/축소가 비활성화됩니다. 즉, 사용자가 스크롤만 할 수 있고 사이트가 네이티브 애플리케이션처럼 느껴지게 됩니다. 전반적으로 모든 사이트에서 이것을 권장하는 것은 아니므로 주의하십시오!
타이포그래피 및 링크
부트스트랩은 기본 전역 디스플레이, 타이포그래피 및 링크 스타일을 설정합니다. 구체적으로, 우리는:
background-color: #fff;에 설정body
@font-family-base, @font-size-base및 @line-height-base속성을 활자체 기반으로 사용
를 통해 전체 링크 색상을 설정하고 @link-color다음에만 링크 밑줄을 적용하십시오.:hover
그리드 시스템은 콘텐츠를 포함하는 일련의 행과 열을 통해 페이지 레이아웃을 만드는 데 사용됩니다. 부트스트랩 그리드 시스템이 작동하는 방식은 다음과 같습니다.
적절한 정렬 및 패딩을 위해 행은 .container(고정 너비) 또는 (전체 너비) 내에 배치되어야 합니다 ..container-fluid
행을 사용하여 열의 수평 그룹을 만듭니다.
콘텐츠는 열 내에 배치되어야 하며 열만 행의 직계 자식일 수 있습니다.
.row와 같은 미리 정의된 그리드 클래스 .col-xs-4는 그리드 레이아웃을 빠르게 만드는 데 사용할 수 있습니다. 더 적은 믹스인을 더 의미론적인 레이아웃에 사용할 수도 있습니다.
열은 을 통해 거터(열 콘텐츠 사이의 간격)를 padding만듭니다. 해당 패딩은 s의 음수 여백을 통해 첫 번째 및 마지막 열의 행에서 오프셋됩니다 .row.
음수 여백은 아래 예가 내어쓰기된 이유입니다. 그리드 열 내의 콘텐츠가 그리드가 아닌 콘텐츠와 정렬되도록 하기 위한 것입니다.
그리드 열은 확장하려는 12개의 사용 가능한 열 수를 지정하여 생성됩니다. 예를 들어 3개의 동일한 열은 3개를 사용 .col-xs-4합니다.
단일 행에 12개 이상의 열이 있는 경우 추가 열의 각 그룹은 하나의 단위로 새 줄로 줄바꿈됩니다.
그리드 클래스는 화면 너비가 중단점 크기보다 크거나 같은 장치에 적용되며 더 작은 장치를 대상으로 하는 그리드 클래스를 재정의합니다. 따라서 예를 들어 .col-md-*요소에 클래스를 적용하면 중형 장치의 스타일 지정에 영향을 줄 뿐만 아니라 .col-lg-*클래스가 없는 경우 대형 장치에도 영향을 줍니다.
이러한 원칙을 코드에 적용하기 위한 예제를 살펴보십시오.
미디어 쿼리
Less 파일에서 다음 미디어 쿼리를 사용하여 그리드 시스템에서 주요 중단점을 만듭니다.
max-width우리는 때때로 CSS를 더 좁은 장치 세트로 제한하기 위해 이러한 미디어 쿼리를 확장 합니다.
그리드 옵션
편리한 표를 사용하여 부트스트랩 그리드 시스템의 여러 측면이 여러 장치에서 어떻게 작동하는지 확인하십시오.
초소형 기기 전화(<768px)
소형 장치 태블릿(≥768px)
중형 장치 데스크탑(≥992px)
대형 장치 데스크탑(≥1200px)
그리드 동작
항상 수평
접혀서 시작, 중단점 위 수평
컨테이너 너비
없음(자동)
750픽셀
970픽셀
1170픽셀
클래스 접두사
.col-xs-
.col-sm-
.col-md-
.col-lg-
열 수
12
열 너비
자동
~62픽셀
~81px
~97px
거터 폭
30px(열의 양쪽에 15px)
중첩 가능
예
오프셋
예
열 순서
예
예: 스택에서 수평으로
단일 .col-md-*그리드 클래스 세트를 사용하여 데스크탑(중형) 장치에서 수평이 되기 전에 모바일 장치 및 태블릿 장치(초소형에서 작은 범위)에서 스택으로 시작하는 기본 그리드 시스템을 만들 수 있습니다. 아무 에나 그리드 기둥을 배치합니다 .row.
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-8
.col-md-4
.col-md-4
.col-md-4
.col-md-4
.col-md-6
.col-md-6
예: 액체 용기
.container가장 바깥쪽 을 로 변경하여 고정 너비 그리드 레이아웃을 전체 너비 레이아웃으로 바꿉니다 .container-fluid.
예: 모바일 및 데스크톱
열이 더 작은 장치에 쌓이는 것을 원하지 않습니까? .col-xs-*.col-md-*열에 추가하여 초소형 및 중형 장치 그리드 클래스를 사용 하십시오. 모든 작동 방식에 대한 더 나은 아이디어는 아래 예를 참조하십시오.
.col-xs-12 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6
.col-xs-6
예: 모바일, 태블릿, 데스크톱
.col-sm-*태블릿 클래스 를 사용하여 훨씬 더 동적이고 강력한 레이아웃을 만들어 이전 예제를 기반으로 빌드합니다 .
.col-xs-12 .col-sm-6 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
예: 열 줄 바꿈
단일 행에 12개 이상의 열이 있는 경우 추가 열의 각 그룹은 하나의 단위로 새 줄로 줄바꿈됩니다.
.col-xs-9
.col-xs-4
9 + 4 = 13 > 12이므로 이 4열 너비 div는 하나의 연속 단위로 새 줄에 래핑됩니다.
.col-xs-6
후속 열은 새 줄을 따라 계속됩니다.
반응형 열 재설정
4가지 계층의 그리드를 사용할 수 있으므로 특정 중단점에서 열이 다른 것보다 높기 때문에 열이 제대로 지워지지 않는 문제가 발생하게 됩니다. 이 문제를 해결하려면 .clearfix와 반응형 유틸리티 클래스 를 함께 사용하세요 .
.col-xs-6 .col-sm-3
뷰포트의 크기를 조정하거나 예를 들어 휴대전화에서 확인하세요.
.col-xs-6 .col-sm-3
.col-xs-6 .col-sm-3
.col-xs-6 .col-sm-3
응답 중단점에서 열 지우기 외에도 오프셋, 푸시 또는 풀을 재설정 해야 할 수 있습니다 . 그리드 예제 에서 실제로 이것을 참조하십시오 .
거터 제거
.row-no-gutters행에서 거터를 제거하고 클래스 가 있는 열을 제거합니다 .
.col-xs-12 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6
.col-xs-6
열 오프셋
.col-md-offset-*클래스 를 사용하여 열을 오른쪽으로 이동합니다 . 이러한 클래스는 열만큼 열의 왼쪽 여백을 늘 *립니다. 예를 들어, 4개의 열 위로 .col-md-offset-4이동 합니다..col-md-4
.col-md-4
.col-md-4 .col-md-offset-4
.col-md-3 .col-md-offset-3
.col-md-3 .col-md-offset-3
.col-md-6 .col-md-offset-3
.col-*-offset-0하위 그리드 계층의 오프셋을 클래스 로 재정의할 수도 있습니다 .
중첩 열
기본 그리드를 사용하여 콘텐츠를 중첩하려면 기존 열 내에 새로운 열 .row집합을 추가합니다 . 중첩된 행에는 최대 12개 이하의 열을 추가하는 열 집합이 포함되어야 합니다(사용 가능한 열 12개를 모두 사용할 필요는 없음)..col-sm-*.col-sm-*
레벨 1: .col-sm-9
레벨 2: .col-xs-8 .col-sm-6
레벨 2: .col-xs-4 .col-sm-6
열 순서
.col-md-push-*및 .col-md-pull-*수정자 클래스 를 사용하여 내장 그리드 열의 순서를 쉽게 변경할 수 있습니다 .
변수는 열 수, 여백 너비 및 부동 열을 시작할 미디어 쿼리 지점을 결정합니다. 우리는 이것을 사용하여 위에 설명된 미리 정의된 그리드 클래스와 아래 나열된 사용자 지정 믹스인을 생성합니다.
믹신
믹스인은 그리드 변수와 함께 개별 그리드 열에 대한 의미론적 CSS를 생성하는 데 사용됩니다.
사용 예
변수를 사용자 정의 값으로 수정하거나 기본값과 함께 믹스인을 사용할 수 있습니다. 다음은 기본 설정을 사용하여 간격이 있는 2열 레이아웃을 만드는 예입니다.
타이포그래피
제목
까지의 모든 HTML 제목 <h1>을 <h6>사용할 수 있습니다. 제목의 글꼴 스타일을 일치시키고 싶지만 텍스트가 인라인으로 표시되기를 원하는 경우 .h1through 클래스도 사용할 수 있습니다..h6
h1. 부트스트랩 제목
세미볼트 36px
h2. 부트스트랩 제목
세미볼트 30px
h3. 부트스트랩 제목
세미볼드 24픽셀
h4. 부트스트랩 제목
세미볼트 18px
h5. 부트스트랩 제목
세미볼트 14px
h6. 부트스트랩 제목
세미볼트 12px
일반 <small>태그 또는.small 클래스
h1. 부트스트랩 제목 보조 텍스트
h2. 부트스트랩 제목 보조 텍스트
h3. 부트스트랩 제목 보조 텍스트
h4. 부트스트랩 제목 보조 텍스트
h5. 부트스트랩 제목 보조 텍스트
h6. 부트스트랩 제목 보조 텍스트
본문
부트스트랩의 전역 기본값 font-size은 14px 이며 a line-height는 1.428 입니다. 에 적용됩니다.<body> 및 모든 단락에 적용됩니다. 또한 <p>(단락)은 계산된 줄 높이의 절반(기본적으로 10px)의 아래쪽 여백을 받습니다.
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commododo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commododo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
리드 본문 카피
를 추가하여 단락을 돋보이게 만드십시오 .lead.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commododo luctus.
적은 비용으로 구축
활자체 척도는 variables.less에 있는 두 개의 Less 변수를 기반@font-size-base 으로 합니다 @line-height-base. 첫 번째는 전체에 걸쳐 사용되는 기본 글꼴 크기이고 두 번째는 기본 줄 높이입니다. 우리는 이러한 변수와 몇 가지 간단한 수학을 사용하여 모든 유형 등의 여백, 패딩 및 줄 높이를 만듭니다. 사용자 정의하면 Bootstrap이 적응합니다.
인라인 텍스트 요소
표시된 텍스트
다른 컨텍스트에서의 관련성으로 인해 텍스트 실행을 강조 표시하려면 <mark>태그를 사용하십시오.
마크 태그를 사용하여가장 밝은 부분텍스트.
삭제된 텍스트
삭제된 텍스트 블록을 표시하려면 <del>태그를 사용하십시오.
이 텍스트 줄은 삭제된 텍스트로 처리됩니다.
취소선 텍스트
더 이상 관련이 없는 텍스트 블록을 표시하려면 <s>태그를 사용하십시오.
이 텍스트 줄은 더 이상 정확하지 않은 것으로 간주됩니다.
삽입된 텍스트
문서에 추가 사항을 표시하려면 <ins>태그를 사용하십시오.
이 텍스트 줄은 문서에 추가된 것으로 간주됩니다.
밑줄이 그어진 텍스트
텍스트에 밑줄을 긋려면 <u>태그를 사용하십시오.
이 텍스트 줄은 밑줄이 그어진 것으로 렌더링됩니다.
가벼운 스타일로 HTML의 기본 강조 태그를 사용하십시오.
작은 텍스트
인라인 또는 텍스트 블록을 강조하지 않으려면 <small>태그를 사용하여 텍스트를 상위 크기의 85%로 설정합니다. 머리글 요소 font-size는 중첩 <small>요소에 대해 고유한 요소를 받습니다.
.small대안 으로 any 대신에 인라인 요소를 사용할 수 있습니다 <small>.
이 텍스트 줄은 작은 글씨로 취급되어야 합니다.
용감한
더 무거운 글꼴 두께로 텍스트 스니펫을 강조합니다.
다음 텍스트 스니펫은 굵은 텍스트로 렌더링됩니다 .
기울임꼴
기울임꼴로 된 텍스트 스니펫을 강조합니다.
다음 텍스트 스니펫은 기울임꼴 텍스트로 렌더링됩니다 .
대체 요소
HTML5에서 <b>자유롭게 사용하세요 . 추가적인 중요성을 전달하지 않고 단어나 구를 강조하기 위한 것이며 주로 음성, 기술 용어 등에 사용됩니다.<i><b><i>
정렬 클래스
텍스트 정렬 클래스를 사용하여 텍스트를 구성요소에 쉽게 재정렬합니다.
왼쪽 정렬된 텍스트입니다.
가운데 정렬된 텍스트.
오른쪽 정렬된 텍스트.
정당화 된 텍스트.
줄 바꿈 텍스트가 없습니다.
변환 클래스
텍스트 대문자 클래스를 사용하여 구성 요소의 텍스트를 변환합니다.
소문자 텍스트.
대문자 텍스트.
대문자로 된 텍스트.
약어
<abbr>마우스 오버 시 확장된 버전을 표시하는 약어 및 두문자어에 대한 HTML 요소의 스타일화된 구현입니다 . a가 있는 약어title 에는 밝은 점선 하단 테두리와 호버에 대한 도움말 커서가 있어 호버 및 보조 기술 사용자에게 추가 컨텍스트를 제공합니다.
기본 약어
속성이라는 단어의 약어는 attr 입니다.
이니셜리즘
.initialism약간 더 작은 글꼴 크기에 대한 약어에 추가 합니다.
HTML 은 얇게 썬 빵 이후로 최고입니다.
구애
가장 가까운 조상 또는 전체 업무에 대한 연락처 정보를 제시하십시오. 모든 줄을 <br>.
Twitter, Inc. 1355 Market Street, Suite 900 San Francisco, CA 94103 전화 : (123) 456-7890
성명 [email protected]
인용구
문서 내에서 다른 소스의 콘텐츠 블록을 인용하는 경우.
기본 인용구
HTML 을 인용문으로 <blockquote>둘러 쌉니다 . 직선 따옴표의 경우 .<p>
Lorem ipsum dolor sitmet, consectetur adipiscing elit. Integer posuere erat ante.
인용 부호 옵션
표준에 대한 단순한 변형을 위한 스타일 및 내용 변경 <blockquote>.
소스 이름 지정
<footer>소스 식별을 위해 추가합니다 . 소스 작업의 이름을 <cite>.
Lorem ipsum dolor sitmet, consectetur adipiscing elit. Integer posuere erat ante.
대체 디스플레이
.blockquote-reverse콘텐츠가 오른쪽으로 정렬된 인용구를 추가 합니다.
Lorem ipsum dolor sitmet, consectetur adipiscing elit. Integer posuere erat ante.
기울기
무순
순서가 명시적으로 중요 하지 않은 항목 목록입니다 .
Lorem ipsum dolor sitmet
Consectetur adipiscing 엘리트
정수 molestie lorem at massa
Pretium nisl aliquet의 시설
눌라 볼룻팟 알리콰암 벨릿
Phasellus iaculis neque
Purus sodales ultricies
베스티불룸 라오렛 포티터 sem
Ac tristique libero volutpat
Faucibus porta lacus fringilla vel
Aenean sit amet erat nunc
Eget porttitor lorem
주문
순서 가 명시적으로 중요한 항목 목록입니다 .
Lorem ipsum dolor sitmet
Consectetur adipiscing 엘리트
정수 molestie lorem at massa
Pretium nisl aliquet의 시설
눌라 볼룻팟 알리콰암 벨릿
Faucibus porta lacus fringilla vel
Aenean sit amet erat nunc
Eget porttitor lorem
스타일이 없는
목록 항목 에서 기본 list-style및 왼쪽 여백을 제거합니다(직계 자식만 해당). 이것은 직계 자식 목록 항목에만 적용됩니다 . 즉, 모든 중첩 목록에도 클래스를 추가해야 합니다.
Lorem ipsum dolor sitmet
Consectetur adipiscing 엘리트
정수 molestie lorem at massa
Pretium nisl aliquet의 시설
눌라 볼룻팟 알리콰암 벨릿
Phasellus iaculis neque
Purus sodales ultricies
베스티불룸 라오렛 포티터 sem
Ac tristique libero volutpat
Faucibus porta lacus fringilla vel
Aenean sit amet erat nunc
Eget porttitor lorem
인라인
display: inline-block;가벼운 패딩과 함께 모든 목록 항목을 한 줄에 배치하십시오 .
로렘 입숨
파셀루스 이아쿨리스
Nulla volutpat
설명
관련 설명이 포함된 용어 목록입니다.
설명 목록
설명 목록은 용어를 정의하는 데 적합합니다.
유이스모드
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
Donec id elit non mi porta gravida at eget metus.
말레수아다 포르타
Etiam porta sem malesuada magna mollis euismod.
가로 설명
용어와 설명을 <dl>나란히 정렬하십시오. 기본 s처럼 스택으로 시작 <dl>하지만 탐색 모음이 확장되면 확장됩니다.
설명 목록
설명 목록은 용어를 정의하는 데 적합합니다.
유이스모드
Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
Donec id elit non mi porta gravida at eget metus.
말레수아다 포르타
Etiam porta sem malesuada magna mollis euismod.
Felis euismod semper eget lacinia
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
자동 자르기
가로 설명 목록은 너무 길어서 왼쪽 열에 맞지 않는 용어를 자릅니다 text-overflow. 더 좁은 뷰포트에서는 기본 스택 레이아웃으로 변경됩니다.
암호
인라인
코드의 인라인 스니펫을 <code>.
예를 들어
<section>인라인으로 래핑해야 합니다.
사용자 입력
<kbd>일반적으로 키보드를 통해 입력되는 입력을 나타내는 데 사용합니다 .
디렉토리를 전환하려면 디렉토리
cd이름 다음에 입력하십시오.
설정을 편집하려면
ctrl + ,
기본 블록
<pre>여러 줄의 코드에 사용 합니다. 적절한 렌더링을 위해 코드에서 꺾쇠 괄호를 이스케이프 처리해야 합니다.
<p>여기에 샘플 텍스트...</p>
.pre-scrollable최대 높이를 350px로 설정하고 y축 스크롤 막대를 제공하는 클래스를 선택적으로 추가할 수 있습니다 .
변수
변수를 나타내기 위해 <var>태그를 사용하십시오.
y = m x + b
샘플 출력
프로그램에서 블록 샘플 출력을 표시하려면 <samp>태그를 사용하십시오.
이 텍스트는 컴퓨터 프로그램의 샘플 출력으로 취급됩니다.
테이블
기본 예
기본 스타일(가벼운 패딩 및 가로 구분선만)의 경우 기본 클래스 .table를 any 에 추가합니다 <table>. 너무 중복되어 보일 수 있지만 캘린더 및 날짜 선택기와 같은 다른 플러그인에 대한 테이블의 광범위한 사용을 감안할 때 우리는 사용자 정의 테이블 스타일을 분리하기로 결정했습니다.
선택적 테이블 캡션.
#
이름
성
사용자 이름
1
표시
장미유
@mdo
2
야곱
손튼
@지방
삼
래리
새
@트위터
줄무늬 행
.table-striped. 안의 테이블 행에 얼룩말 줄무늬를 추가하는 데 사용 합니다 <tbody>.
브라우저 간 호환성
:nth-child줄무늬 테이블은 Internet Explorer 8에서 사용할 수 없는 CSS 선택기 를 통해 스타일이 지정됩니다 .
#
이름
성
사용자 이름
1
표시
장미유
@mdo
2
야곱
손튼
@지방
삼
래리
새
@트위터
테두리가 있는 테이블
.table-bordered표와 셀의 모든 면에 테두리를 추가 합니다.
#
이름
성
사용자 이름
1
표시
장미유
@mdo
2
야곱
손튼
@지방
삼
래리
새
@트위터
호버 행
.table-hover.NET 내의 테이블 행에서 호버 상태를 활성화하려면 추가하십시오 <tbody>.
#
이름
성
사용자 이름
1
표시
장미유
@mdo
2
야곱
손튼
@지방
삼
래리
새
@트위터
요약 테이블
.table-condensed셀 패딩을 반으로 잘라 테이블을 더 작게 만들려면 추가하십시오 .
#
이름
성
사용자 이름
1
표시
장미유
@mdo
2
야곱
손튼
@지방
삼
래리 버드
@트위터
상황별 클래스
상황별 클래스를 사용하여 테이블 행 또는 개별 셀에 색상을 지정합니다.
수업
설명
.active
특정 행이나 셀에 호버 색상을 적용합니다.
.success
성공 또는 긍정적인 작업을 나타냅니다.
.info
중립적인 정보 변경 또는 조치를 나타냅니다.
.warning
주의가 필요할 수 있는 경고를 나타냅니다.
.danger
위험하거나 잠재적으로 부정적인 행동을 나타냅니다.
#
열 제목
열 제목
열 제목
1
열 내용
열 내용
열 내용
2
열 내용
열 내용
열 내용
삼
열 내용
열 내용
열 내용
4
열 내용
열 내용
열 내용
5
열 내용
열 내용
열 내용
6
열 내용
열 내용
열 내용
7
열 내용
열 내용
열 내용
8
열 내용
열 내용
열 내용
9
열 내용
열 내용
열 내용
보조 기술에 의미 전달
색상을 사용하여 테이블 행이나 개별 셀에 의미를 추가하면 시각적 표시만 제공되며 화면 판독기와 같은 보조 기술 사용자에게는 전달되지 않습니다. 색상으로 표시된 정보가 콘텐츠 자체(관련 테이블 행/셀에 표시되는 텍스트)에서 명확하거나 .sr-only클래스에 숨겨진 추가 텍스트와 같은 대체 수단을 통해 포함되는지 확인합니다.
반응형 테이블
작은 장치(768픽셀 미만)에서 가로로 스크롤되도록 아무 항목 .table이나 래핑하여 반응형 테이블을 만듭니다 . .table-responsive너비가 768px보다 큰 항목을 볼 때 이러한 표에는 차이가 없습니다.
세로 자르기/잘림
반응형 테이블은 을 사용하여 overflow-y: hidden테이블의 맨 아래 또는 맨 위 가장자리를 벗어나는 모든 콘텐츠를 잘라냅니다. 특히 드롭다운 메뉴 및 기타 타사 위젯이 잘릴 수 있습니다.
파이어폭스와 필드셋
widthFirefox에는 반응형 테이블을 방해 하는 일부 어색한 필드셋 스타일이 있습니다. 이것은 부트스트랩에서 제공 하지 않는 Firefox 전용 해킹 없이는 재정의할 수 없습니다 .
개별 양식 컨트롤은 자동으로 일부 전역 스타일을 받습니다. 가 포함된 모든 텍스트 <input>, <textarea>및 <select>요소 는 기본적으로 .form-control로 설정됩니다 . 최적의 간격을 위해 width: 100%;레이블과 컨트롤을 감쌉니다 ..form-group
양식 그룹을 입력 그룹과 혼합하지 마십시오.
양식 그룹을 입력 그룹 과 직접 혼합하지 마십시오 . 대신 양식 그룹 내부에 입력 그룹을 중첩하십시오.
인라인 양식
왼쪽 정렬 및 인라인 블록 컨트롤 .form-inline의 경우 양식에 추가 합니다( a일 필요는 없음). 이것은 너비가 최소 768px인 뷰포트 내의 양식에만 적용됩니다.<form>
사용자 정의 너비가 필요할 수 있음
입력 및 선택은 width: 100%;기본적으로 부트스트랩에 적용되었습니다. 인라인 양식 내에서 width: auto;여러 컨트롤이 같은 줄에 있을 수 있도록 재설정합니다. 레이아웃에 따라 추가 사용자 정의 너비가 필요할 수 있습니다.
항상 라벨 추가
모든 입력에 레이블을 포함하지 않으면 화면 판독기가 양식에 문제를 일으키게 됩니다. .sr-only이러한 인라인 양식의 경우 클래스 를 사용하여 레이블을 숨길 수 있습니다 . aria-label, aria-labelledby또는 title속성 과 같은 보조 기술에 대한 레이블을 제공하는 또 다른 대체 방법이 있습니다 . 이들 중 어느 것도 존재하지 않는 경우 화면 판독기는 placeholder속성을 사용할 수 있지만(있는 경우) placeholder다른 레이블 지정 방법에 대한 대체 수단으로 를 사용하는 것은 권장되지 않습니다.
가로 형태
Bootstrap의 미리 정의된 그리드 클래스를 사용하여 양식에 추가하여 수평 레이아웃에서 양식 컨트롤의 레이블과 그룹을 정렬합니다 .form-horizontal( a일 필요는 없음 <form>). 그렇게 하면 .form-groups가 그리드 행처럼 동작하도록 변경되므로 .row.
지원되는 컨트롤
예제 양식 레이아웃에서 지원되는 표준 양식 컨트롤의 예입니다.
입력
가장 일반적인 양식 컨트롤, 텍스트 기반 입력 필드. 모든 HTML5 유형에 대한 지원 포함: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel및 color.
유형 선언 필요
type입력 은 적절하게 선언된 경우에만 완전히 스타일이 지정됩니다 .
입력 그룹
텍스트 기반 이전 및/또는 이후에 통합 텍스트 또는 버튼을 추가하려면 입력 그룹 구성 요소<input> 를 확인하십시오 .
텍스트 영역
여러 줄의 텍스트를 지원하는 양식 컨트롤입니다. rows필요에 따라 속성을 변경 합니다.
체크박스와 라디오
확인란은 목록에서 하나 또는 여러 옵션을 선택하기 위한 것이고 라디오는 여러 옵션 중에서 하나를 선택하기 위한 것입니다.
비활성화된 체크박스와 라디오가 지원되지만 부모의 호버에 "허용되지 않는" 커서를 제공 하려면 부모 , , 또는 에 클래스를 <label>추가해야 합니다 ..disabled.radio.radio-inline.checkbox.checkbox-inline
기본값(스택)
인라인 체크박스와 라디오
같은 줄에 나타나는 컨트롤에 대해 일련의 확인란 또는 라디오에서 .checkbox-inline또는 클래스를 사용합니다 ..radio-inline
레이블 텍스트가 없는 확인란 및 라디오
에 텍스트가 없으면 <label>입력이 예상대로 배치됩니다. 현재 인라인이 아닌 체크박스와 라디오에서만 작동합니다. 보조 기술에 대한 레이블 형식(예: 사용 aria-label)을 계속 제공해야 합니다.
선택
Safari 및 Chrome과 같은 많은 기본 선택 메뉴에는 속성을 통해 수정할 수 없는 둥근 모서리가 있습니다 border-radius.
<select>속성 이 있는 컨트롤의 경우 기본적 multiple으로 여러 옵션이 표시됩니다.
정적 제어
양식 내에서 양식 레이블 옆에 일반 텍스트를 배치해야 하는 .form-control-static경우 <p>.
초점 상태
outline일부 양식 컨트롤 에서 기본 스타일을 제거 box-shadow하고 대신 에 적용합니다 :focus.
데모 :focus상태
위의 예제 입력은 설명서의 사용자 정의 스타일을 사용 :focus하여 .form-control.
비활성화 상태
disabled사용자 상호 작용을 방지하기 위해 입력에 부울 속성을 추가합니다 . 비활성화된 입력은 더 밝게 나타나고 not-allowed커서를 추가합니다.
비활성화된 필드 세트
disabled속성을 추가하여 한 번에 <fieldset>내의 모든 컨트롤을 비활성화합니다 .<fieldset>
링크 기능에 대한 주의 사항<a>
기본적으로 브라우저는 내부의 모든 기본 양식 컨트롤( 및 요소)을 비활성화된 것으로 처리 <input>하여 <select>키보드 <button>와 <fieldset disabled>마우스 상호 작용을 모두 방지합니다. 그러나 양식에 요소도 포함되어 있는 <a ... class="btn btn-*">경우 이러한 요소에는 의 스타일만 부여됩니다 pointer-events: none. 버튼의 비활성화 상태에 대한 섹션(특히 앵커 요소의 하위 섹션)에서 언급했듯이 이 CSS 속성은 아직 표준화되지 않았으며 Opera 18 이하 또는 Internet Explorer 11에서 완전히 지원되지 않습니다. '는 키보드 사용자가 이러한 링크에 집중하거나 활성화할 수 없도록 합니다. 따라서 안전을 위해 사용자 정의 JavaScript를 사용하여 이러한 링크를 비활성화하십시오.
브라우저 간 호환성
Bootstrap은 모든 브라우저에서 이러한 스타일을 적용하지만 Internet Explorer 11 이하 disabled에서는 <fieldset>. 사용자 정의 JavaScript를 사용하여 이러한 브라우저에서 필드 세트를 비활성화하십시오.
읽기 전용 상태
readonly입력 값의 수정을 방지하기 위해 입력에 부울 속성을 추가합니다 . 읽기 전용 입력은 비활성화된 입력처럼 더 밝게 나타나지만 표준 커서는 유지됩니다.
도움말 텍스트
양식 컨트롤에 대한 블록 수준 도움말 텍스트입니다.
도움말 텍스트를 양식 컨트롤과 연결
aria-describedby도움말 텍스트는 속성 사용과 관련된 양식 컨트롤과 명시적으로 연결되어야 합니다 . 이렇게 하면 화면 판독기와 같은 보조 기술이 사용자가 컨트롤에 초점을 맞추거나 들어갈 때 이 도움말 텍스트를 알릴 수 있습니다.
검증 상태
부트스트랩에는 양식 컨트롤의 오류, 경고 및 성공 상태에 대한 유효성 검사 스타일이 포함되어 있습니다. 사용하려면 상위 요소에 .has-warning, .has-error또는 를 추가하십시오 . 해당 요소 내의 .has-success모든 .control-label, .form-control및 는 유효성 검사 스타일을 받습니다..help-block
보조 기술 및 색맹 사용자에게 유효성 검사 상태 전달
이러한 유효성 검사 스타일을 사용하여 양식 컨트롤의 상태를 표시하는 것은 시각적인 색상 기반 표시만 제공하며 화면 판독기와 같은 보조 기술 사용자나 색맹 사용자에게는 전달되지 않습니다.
상태의 대체 표시도 제공되는지 확인하십시오. 예를 들어, 양식 컨트롤의 텍스트 자체에 상태에 대한 힌트를 포함하거나 <label>(다음 코드 예제의 경우와 같이), Glyphicon.sr-only 을 포함하거나( 클래스 를 사용하는 적절한 대체 텍스트 포함 - Glyphicon 예제 참조 ) 추가 도움말 텍스트 블록. aria-invalid="true"특히 보조 기술의 경우 잘못된 양식 컨트롤에 속성 을 할당할 수도 있습니다 .
옵션 아이콘 포함
.has-feedback및 오른쪽 아이콘 을 추가하여 선택적 피드백 아이콘을 추가할 수도 있습니다 .
피드백 아이콘은 텍스트 <input class="form-control">요소에서만 작동합니다.
아이콘, 레이블 및 입력 그룹
레이블이 없는 입력 과 오른쪽에 추가 기능이 있는 입력 그룹 의 경우 피드백 아이콘을 수동으로 배치해야 합니다. 접근성을 위해 모든 입력에 레이블을 제공하는 것이 좋습니다. 레이블이 표시되지 않도록 하려면 .sr-only클래스와 함께 레이블을 숨깁니다. 레이블 없이 해야 하는 top경우 피드백 아이콘의 값을 조정합니다. 입력 그룹의 경우 right애드온의 너비에 따라 값을 적절한 픽셀 값으로 조정합니다.
아이콘의 의미를 보조 기술에 전달
화면 판독기와 같은 보조 기술이 아이콘의 의미를 올바르게 전달하도록 하려면 추가 숨겨진 텍스트가 클래스에 포함되어야 하고 .sr-only클래스가 사용하는 것과 관련된 양식 컨트롤과 명시적으로 연결되어야 합니다 aria-describedby. <label>또는 의미(예: 특정 텍스트 입력 필드에 대한 경고가 있다는 사실)가 양식 컨트롤과 관련된 실제 텍스트를 변경하는 것과 같은 다른 형식으로 전달되도록 합니다 .
다음 예제에서는 이미 텍스트 자체에서 해당 양식 컨트롤의 유효성 검사 상태를 언급하지만 <label>위의 기술( .sr-only텍스트 및 aria-describedby)은 설명을 위해 포함되었습니다.
가로 및 인라인 형식의 선택적 아이콘
.sr-only숨겨진 레이블 이 있는 선택적 아이콘
속성 과 같은 다른 레이블 지정 옵션을 사용하는 대신 클래스를 사용하여 .sr-only양식 컨트롤을 숨기는 경우 Bootstrap은 아이콘이 추가되면 자동으로 아이콘의 위치를 조정합니다.<label>aria-label
(성공)
@
(성공)
크기 조절
와 같은 클래스를 사용하여 높이를 설정 .input-lg하고 와 같은 그리드 열 클래스를 사용하여 너비를 설정 .col-lg-*합니다.
높이 사이징
버튼 크기와 일치하는 더 높거나 짧은 양식 컨트롤을 만듭니다.
가로 양식 그룹 크기
또는 .form-horizontal를 추가하여 레이블 및 양식 컨트롤의 크기를 빠르게 조정합니다 ..form-group-lg.form-group-sm
열 크기 조정
원하는 너비를 쉽게 적용할 수 있도록 그리드 열 또는 사용자 지정 상위 요소에 입력을 래핑합니다.
버튼
버튼 태그
<a>, <button>또는 <input>요소 에서 버튼 클래스를 사용합니다 .
상황별 사용법
버튼 클래스는 <a>및 <button>요소에서 사용할 수 있지만 <button>nav 및 navbar 구성 요소 내에서는 요소만 지원됩니다.
버튼 역할을 하는 링크
<a>요소가 현재 페이지 내의 다른 문서나 섹션으로 이동하는 대신 페이지 내 기능을 트리거하는 버튼 역할을 하는 경우 적절한 role="button".
브라우저 간 렌더링
모범 사례로 가능하면 요소 를 사용하는 것이 좋습니다.<button> 으로 브라우저 간 렌더링 일치를 보장하기 위해
무엇보다도 Firefox <30 에는 - 기반 버튼 을 설정하지 못하게 하는 버그가 있어 Firefox 의 다른 버튼 높이와 정확히 일치하지 않습니다.line-height<input>
옵션
사용 가능한 버튼 클래스를 사용하여 스타일이 지정된 버튼을 빠르게 만듭니다.
보조 기술에 의미 전달
버튼에 의미를 추가하기 위해 색상을 사용하면 시각적 표시만 제공되며 스크린 리더와 같은 보조 기술 사용자에게는 전달되지 않습니다. 색상으로 표시된 정보가 콘텐츠 자체(버튼의 보이는 텍스트)에서 명확하거나 .sr-only클래스와 함께 숨겨진 추가 텍스트와 같은 대체 수단을 통해 포함되는지 확인합니다.
크기
더 크거나 작은 버튼이 마음에 드시나요? 추가 크기 .btn-lg의 경우 .btn-sm, 또는 .btn-xs을(를) 추가합니다.
를 추가하여 부모의 전체 너비에 걸쳐 있는 블록 수준 버튼을 만듭니다 .btn-block.
활성 상태
Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <button> elements, this is done via :active. For <a> elements, it's done with .active. However, you may use .active on <button>s (and include the aria-pressed="true" attribute) should you need to replicate the active state programmatically.
Button element
No need to add :active as it's a pseudo-class, but if you need to force the same appearance, go ahead and add .active.
We use .disabled as a utility class here, similar to the common .active class, so no prefix is required.
Link functionality caveat
This class uses pointer-events: none to try to disable the link functionality of <a>s, but that CSS property is not yet standardized and isn't fully supported in Opera 18 and below, or in Internet Explorer 11. In addition, even in browsers that do support pointer-events: none, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, use custom JavaScript to disable such links.
Images
Responsive images
Images in Bootstrap 3 can be made responsive-friendly via the addition of the .img-responsive class. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element.
To center images which use the .img-responsive class, use .center-block instead of .text-center. See the helper classes section for more details about .center-block usage.
SVG images and IE 8-10
In Internet Explorer 8-10, SVG images with .img-responsive are disproportionately sized. To fix this, add width: 100% \9; where necessary. Bootstrap doesn't apply this automatically as it causes complications to other image formats.
Image shapes
Add classes to an <img> element to easily style images in any project.
Cross-browser compatibility
Keep in mind that Internet Explorer 8 lacks support for rounded corners.
Helper classes
Contextual colors
Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Dealing with specificity
Sometimes emphasis classes cannot be applied due to the specificity of another selector. In most cases, a sufficient workaround is to wrap your text in a <span> with the class.
Conveying meaning to assistive technologies
Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the contextual colors are only used to reinforce meaning that is already present in the text/markup), or is included through alternative means, such as additional text hidden with the .sr-only class.
Contextual backgrounds
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Dealing with specificity
Sometimes contextual background classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a <div> with the class.
Conveying meaning to assistive technologies
As with contextual colors, ensure that any meaning conveyed through color is also conveyed in a format that is not purely presentational.
Close icon
Use the generic close icon for dismissing content like modals and alerts.
Carets
Use carets to indicate dropdown functionality and direction. Note that the default caret will reverse automatically in dropup menus.
Quick floats
Float an element to the left or right with a class. !important is included to avoid specificity issues. Classes can also be used as mixins.
Not for use in navbars
To align components in navbars with utility classes, use .navbar-left or .navbar-right instead. See the navbar docs for details.
Center content blocks
Set an element to display: block and center via margin. Available as a mixin and class.
Clearfix
Easily clear floats by adding .clearfixto the parent element. Utilizes the micro clearfix as popularized by Nicolas Gallagher. Can also be used as a mixin.
Showing and hiding content
Force an element to be shown or hidden (including for screen readers) with the use of .show and .hidden classes. These classes use !important to avoid specificity conflicts, just like the quick floats. They are only available for block level toggling. They can also be used as mixins.
.hide is available, but it does not always affect screen readers and is deprecated as of v3.0.1. Use .hidden or .sr-only instead.
Furthermore, .invisible can be used to toggle only the visibility of an element, meaning its display is not modified and the element can still affect the flow of the document.
Screen reader and keyboard navigation content
Hide an element to all devices except screen readers with .sr-only. Combine .sr-only with .sr-only-focusable to show the element again when it's focused (e.g. by a keyboard-only user). Necessary for following accessibility best practices. Can also be used as mixins.
Image replacement
Utilize the .text-hide class or mixin to help replace an element's text content with a background image.
Responsive utilities
For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.
Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.
Available classes
Use a single or combination of the available classes for toggling content across viewport breakpoints.
Extra small devices Phones (<768px)
Small devices Tablets (≥768px)
Medium devices Desktops (≥992px)
Large devices Desktops (≥1200px)
.visible-xs-*
Visible
Hidden
Hidden
Hidden
.visible-sm-*
Hidden
Visible
Hidden
Hidden
.visible-md-*
Hidden
Hidden
Visible
Hidden
.visible-lg-*
Hidden
Hidden
Hidden
Visible
.hidden-xs
Hidden
Visible
Visible
Visible
.hidden-sm
Visible
Hidden
Visible
Visible
.hidden-md
Visible
Visible
Hidden
Visible
.hidden-lg
Visible
Visible
Visible
Hidden
As of v3.2.0, the .visible-*-* classes for each breakpoint come in three variations, one for each CSS display property value listed below.
Group of classes
CSS display
.visible-*-block
display: block;
.visible-*-inline
display: inline;
.visible-*-inline-block
display: inline-block;
So, for extra small (xs) screens for example, the available .visible-*-* classes are: .visible-xs-block, .visible-xs-inline, and .visible-xs-inline-block.
The classes .visible-xs, .visible-sm, .visible-md, and .visible-lg also exist, but are deprecated as of v3.2.0. They are approximately equivalent to .visible-*-block, except with additional special cases for toggling <table>-related elements.
Print classes
Similar to the regular responsive classes, use these for toggling content for print.
The class .visible-print also exists but is deprecated as of v3.2.0. It is approximately equivalent to .visible-print-block, except with additional special cases for <table>-related elements.
Test cases
Resize your browser or load on different devices to test the responsive utility classes.
Visible on...
Green checkmarks indicate the element is visible in your current viewport.
Extra small✔ x-small에서 볼 수 있음
Small✔ 작은 화면에서 볼 수 있음
Medium✔ 매체에서 볼 수 있음
크기가 큰✔ Visible on large
Extra small and small✔ x-small 및 small에서 볼 수 있음
중형 및 대형✔ Visible on medium and large
Extra small and medium✔ x-small 및 medium에서 볼 수 있음
크고 작은✔ Visible on small and large
초대형 및 소형✔ Visible on x-small and large
Small and medium✔ 중소형에서 볼 수 있음
Hidden on...
Here, green checkmarks also indicate the element is hidden in your current viewport.
Extra small✔ x-small에 숨겨진
Small✔ 작은 곳에 숨겨져 있습니다.
Medium✔ Hidden on medium
Large✔ Hidden on large
Extra small and small✔ Hidden on x-small and small
Medium and large✔ Hidden on medium and large
Extra small and medium✔ Hidden on x-small and medium
Small and large✔ Hidden on small and large
Extra small and large✔ Hidden on x-small and large
Small and medium✔ Hidden on small and medium
Using Less
Bootstrap's CSS is built on Less, a preprocessor with additional functionality like variables, mixins, and functions for compiling CSS. Those looking to use the source Less files instead of our compiled CSS files can make use of the numerous variables and mixins we use throughout the framework.
Bootstrap can be used in at least two ways: with the compiled CSS or with the source Less files. To compile the Less files, consult the Getting Started section for how to setup your development environment to run the necessary commands.
Third party compilation tools may work with Bootstrap, but they are not supported by our core team.
Variables
Variables are used throughout the entire project as a way to centralize and share commonly used values like colors, spacing, or font stacks. For a complete breakdown, please see the Customizer.
Colors
Easily make use of two color schemes: grayscale and semantic. Grayscale colors provide quick access to commonly used shades of black while semantic include various colors assigned to meaningful contextual values.
Use any of these color variables as they are or reassign them to more meaningful variables for your project.
Scaffolding
A handful of variables for quickly customizing key elements of your site's skeleton.
Links
Easily style your links with the right color with only one value.
Note that the @link-hover-color uses a function, another awesome tool from Less, to automagically create the right hover color. You can use darken, lighten, saturate, and desaturate.
Typography
Easily set your typeface, text size, leading, and more with a few quick variables. Bootstrap makes use of these as well to provide easy typographic mixins.
Icons
Two quick variables for customizing the location and filename of your icons.
Components
Components throughout Bootstrap make use of some default variables for setting common values. Here are the most commonly used.
Vendor mixins
Vendor mixins are mixins to help support multiple browsers by including all relevant vendor prefixes in your compiled CSS.
The mixin is deprecated as of v3.2.0, with the introduction of Autoprefixer. To preserve backwards-compatibility, Bootstrap will continue to use the mixin internally until Bootstrap v4.
Rounded corners
Today all modern browsers support the non-prefixed border-radius property. As such, there is no .border-radius() mixin, but Bootstrap does include shortcuts for quickly rounding two corners on a particular side of an object.
Box (Drop) shadows
If your target audience is using the latest and greatest browsers and devices, be sure to just use the box-shadow property on its own. If you need support for older Android (pre-v4) and iOS devices (pre-iOS 5), use the deprecated mixin to pick up the required -webkit prefix.
The mixin is deprecated as of v3.1.0, since Bootstrap doesn't officially support the outdated platforms that don't support the standard property. To preserve backwards-compatibility, Bootstrap will continue to use the mixin internally until Bootstrap v4.
Be sure to use rgba() colors in your box shadows so they blend as seamlessly as possible with backgrounds.
Transitions
Multiple mixins for flexibility. Set all transition information with one, or specify a separate delay and duration as needed.
The mixins are deprecated as of v3.2.0, with the introduction of Autoprefixer. To preserve backwards-compatibility, Bootstrap will continue to use the mixins internally until Bootstrap v4.
Transformations
Rotate, scale, translate (move), or skew any object.
The mixins are deprecated as of v3.2.0, with the introduction of Autoprefixer. To preserve backwards-compatibility, Bootstrap will continue to use the mixins internally until Bootstrap v4.
Animations
A single mixin for using all of CSS3's animation properties in one declaration and other mixins for individual properties.
The mixins are deprecated as of v3.2.0, with the introduction of Autoprefixer. To preserve backwards-compatibility, Bootstrap will continue to use the mixins internally until Bootstrap v4.
Opacity
Set the opacity for all browsers and provide a filter fallback for IE8.
Placeholder text
Provide context for form controls within each field.
Columns
Generate columns via CSS within a single element.
Gradients
Easily turn any two colors into a background gradient. Get more advanced and set a direction, use three colors, or use a radial gradient. With a single mixin you get all the prefixed syntaxes you'll need.
You can also specify the angle of a standard two-color, linear gradient:
If you need a barber-stripe style gradient, that's easy, too. Just specify a single color and we'll overlay a translucent white stripe.
Up the ante and use three colors instead. Set the first color, the second color, the second color's color stop (a percentage value like 25%), and the third color with these mixins:
Heads up! Should you ever need to remove a gradient, be sure to remove any IE-specific filter you may have added. You can do that by using the .reset-filter() mixin alongside background-image: none;.
Utility mixins
Utility mixins are mixins that combine otherwise unrelated CSS properties to achieve a specific goal or task.
Clearfix
Forget adding class="clearfix" to any element and instead add the .clearfix() mixin where appropriate. Uses the micro clearfix from Nicolas Gallagher.
Horizontal centering
Quickly center any element within its parent. Requires width or max-width to be set.
Sizing helpers
Specify the dimensions of an object more easily.
Resizable textareas
Easily configure the resize options for any textarea, or any other element. Defaults to normal browser behavior (both).
Truncating text
Easily truncate text with an ellipsis with a single mixin. Requires element to be block or inline-block level.
Retina images
Specify two image paths and the @1x image dimensions, and Bootstrap will provide an @2x media query. If you have many images to serve, consider writing your retina image CSS manually in a single media query.
Using Sass
While Bootstrap is built on Less, it also has an official Sass port. We maintain it in a separate GitHub repository and handle updates with a conversion script.
What's included
Since the Sass port has a separate repo and serves a slightly different audience, the contents of the project differ greatly from the main Bootstrap project. This ensures the Sass port is as compatible with as many Sass-based systems as possible.
Path
Description
lib/
Ruby gem code (Sass configuration, Rails and Compass integrations)