صور Bootstrap
أشكال صورة Bootstrap
زوايا مدورة:
دائرة:
ظفري:
زوايا مدورة
يضيف الفصل .img-rounded
زوايا مستديرة للصورة (لا يدعم IE8 الزوايا المستديرة):
مثال
<img src="cinqueterre.jpg" class="img-rounded" alt="Cinque Terre">
دائرة
يقوم .img-circle
الفصل بتشكيل الصورة على شكل دائرة (لا يدعم IE8 الزوايا المستديرة):
مثال
<img src="cinqueterre.jpg" class="img-circle" alt="Cinque
Terre">
ظفري
يقوم .img-thumbnail
الفصل بتشكيل الصورة إلى صورة مصغرة:
مثال
<img src="cinqueterre.jpg" class="img-thumbnail" alt="Cinque Terre">
صور مستجيبة
الصور تأتي في جميع الأحجام. وكذلك الشاشات. يتم ضبط الصور المتجاوبة تلقائيًا لتناسب حجم الشاشة.
قم بإنشاء صور متجاوبة عن طريق إضافة .img-responsive
فئة إلى <img>
العلامة. سيتم بعد ذلك تغيير حجم الصورة بشكل جيد مع العنصر الأصلي.
.img-responsive
ينطبق display: block;
الفصل وعلى max-width: 100%;
الصورة
height: auto;
:
مثال
<img class="img-responsive" src="img_chania.jpg" alt="Chania">
معرض الصور
يمكنك أيضًا استخدام نظام شبكة Bootstrap مع .thumbnail
الفصل لإنشاء معرض للصور.
ملاحظة: سوف تتعلم المزيد عن نظام الشبكة لاحقًا في هذا البرنامج التعليمي (كيفية إنشاء تخطيط بكمية مختلفة من الأعمدة).
مثال
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<a href="/w3images/lights.jpg">
<img src="/w3images/lights.jpg" alt="Lights" style="width:100%">
<div class="caption">
<p>Lorem ipsum...</p>
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<a href="/w3images/nature.jpg">
<img src="/w3images/nature.jpg" alt="Nature" style="width:100%">
<div class="caption">
<p>Lorem ipsum...</p>
</div>
</a>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<a href="/w3images/fjords.jpg">
<img src="/w3images/fjords.jpg" alt="Fjords" style="width:100%">
<div class="caption">
<p>Lorem ipsum...</p>
</div>
</a>
</div>
</div>
</div>
التضمينات المستجيبة
اسمح أيضًا لمقاطع الفيديو أو عروض الشرائح بالحجم المناسب على أي جهاز.
يمكن تطبيق الفئات مباشرة على عناصر <iframe> و <embed> و <video> و <كائن>.
The following example creates a responsive video by adding an .embed-responsive-item
class
to an <iframe>
tag (the video will then scale nicely to the parent element).
The containing <div>
defines the aspect ratio of the video:
Example
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
What is aspect ratio?
The aspect ratio of an image
describes the proportional relationship between its width and its height. Two common video aspect ratios are 4:3
(the universal video format of the 20th
century), and 16:9 (universal for HD television and European digital
television).
You can choose between two aspect ratio classes:
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item" src="..."></iframe>
</div>
Complete Bootstrap Image Reference
For a complete reference of all image classes, go to our complete Bootstrap Image Reference.