Bootstrap 图片
Bootstrap 对图片的支持。Bootstrap 提供了三个可对图片应用简单样式的 class:
请看下面的实例演示:
<!DOCTYPE html><html><head> <title>Bootstrap 实例 - 图像</title> <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script></head><body><img class="img-rounded lazy" src="/static/imghwm/default1.png" data-src="/wp-content/uploads/2014/06/download.png" alt="Bootstrap学习(3)_html/css_WEB-ITnose" ><img class="img-circle lazy" src="/static/imghwm/default1.png" data-src="/wp-content/uploads/2014/06/download.png" alt="Bootstrap学习(3)_html/css_WEB-ITnose" ><img class="img-thumbnail lazy" src="/static/imghwm/default1.png" data-src="/wp-content/uploads/2014/06/download.png" alt="Bootstrap学习(3)_html/css_WEB-ITnose" ></body></html>
显示结果如下:
类
以下类可用于任何图片中。
.img-rounded | 为图片添加圆角 (IE8 不支持) |
.img-circle | 将图片变为圆形 (IE8 不支持) |
.img-thumbnail | 缩略图功能 |
.img-responsive | 图片响应式 (将很好地扩展到父元素) |
圆角的图片
<meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> <div style="color:white"> <h2 id="图片">图片</h2> <p> .img-rounded 类为图片添加圆角 (IE8 不支持):</p> <img class="img-rounded lazy" src="/static/imghwm/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
效果如下图所示:
圆形的图片
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> </head> <body style = "background-color:black"> <div class="container" style = "color:white"> <h2 id="图片">图片</h2> <p> .img-rounded 类为图片添加圆角 (IE8 不支持):</p> <img class="img-circle lazy" src="/static/imghwm/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script> </body></html>
效果如下图所示
缩略图
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> </head> <body style = "background-color:black"> <div class="container" style = "color:white"> <h2 id="图片">图片</h2> <p> .img-thumbnail 类可制作图片缩略图:</p> <img class="img-thumbnail lazy" src="/static/imghwm/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script> </body></html>
效果如下图所示:
响应式图片
通过在 标签添加 .img-responsive 类来让图片支持响应式设计。 图片将很好地扩展到父元素。
.img-responsive 类将 max-width: 100%; 和 height: auto; 样式应用在图片上:
<meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"> <div style="color:white"> <h2 id="图片">图片</h2> <p> .img-thumbnail 类可制作图片缩略图:</p> <img class="img-responsive lazy" src="/static/imghwm/default1.png" data-src="1.jpg" alt="Cinque Terre" style="max-width:90%" style="max-width:90%"> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>
效果如下图所示
Bootstrap学习(1):
Bootstrap学习(2):
致谢:感谢您的阅读!

이 기사는 HTML & lt; Progress & Gt에 대해 설명합니다. 요소, 그 목적, 스타일 및 & lt; meter & gt의 차이; 요소. 주요 초점은 & lt; progress & gt; 작업 완료 및 & lt; meter & gt; Stati의 경우

이 기사는 HTML & LT; Datalist & GT에 대해 논의합니다. 자동 완성 제안을 제공하고, 사용자 경험을 향상시키고, 오류를 줄임으로써 양식을 향상시키는 요소. 문자 수 : 159

이 기사는 HTML & lt; meter & gt에 대해 설명합니다. 범위 내에 스칼라 또는 분수 값을 표시하는 데 사용되는 요소 및 웹 개발의 일반적인 응용 프로그램. & lt; meter & gt; & lt; Progress & Gt; 그리고 Ex

이 기사는 모바일 장치의 반응 형 웹 디자인에 필수적인 Viewport Meta Tag에 대해 설명합니다. 적절한 사용이 최적의 컨텐츠 스케일링 및 사용자 상호 작용을 보장하는 방법을 설명하는 반면, 오용은 설계 및 접근성 문제로 이어질 수 있습니다.

이 기사는 html5 & lt; time & gt; 시맨틱 날짜/시간 표현 요소. 인간이 읽을 수있는 텍스트와 함께 기계 가독성 (ISO 8601 형식)에 대한 DateTime 속성의 중요성을 강조하여 Accessibilit를 향상시킵니다.

이 기사에서는 브라우저에서 직접 사용자 입력을 검증하기 위해 필요한, Pattern, Min, Max 및 Length 한계와 같은 HTML5 양식 검증 속성을 사용하는 것에 대해 설명합니다.

이 기사는 & lt; iframe & gt; 외부 컨텐츠를 웹 페이지, 공통 용도, 보안 위험 및 객체 태그 및 API와 같은 대안을 포함시키는 태그의 목적.

기사는 HTML5 크로스 브라우저 호환성을 보장하기위한 모범 사례에 대해 논의하고 기능 감지, 점진적 향상 및 테스트 방법에 중점을 둡니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

Eclipse용 SAP NetWeaver 서버 어댑터
Eclipse를 SAP NetWeaver 애플리케이션 서버와 통합합니다.

MinGW - Windows용 미니멀리스트 GNU
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.

드림위버 CS6
시각적 웹 개발 도구

WebStorm Mac 버전
유용한 JavaScript 개발 도구
