Objek media
Dokumentasi lan conto kanggo obyek media Bootstrap kanggo mbangun komponen sing bola-bali banget kaya komentar blog, tweets, lan liya-liyane.
Tuladha
Objek media mbantu mbangun komponen rumit lan bola-bali ing ngendi sawetara media dipanggonke bebarengan karo konten sing ora mbungkus media kasebut. Kajaba iku, nindakake iki kanthi mung rong kelas sing dibutuhake amarga flexbox.
Ing ngisor iki minangka conto obyek media siji. Mung rong kelas sing dibutuhake - bungkus .media
lan .media-body
isi sampeyan. Padding lan margin opsional bisa dikontrol liwat utilitas spasi .
Judhul media
Apa sampeyan bakal nindakake sing padha kanggo aku? Wektu kanggo ngadhepi musik aku dudu muse sampeyan. Krungu iku ayu, dadi hakim lan bocah-bocah wadon bakal njupuk voting. Aku bisa ngrasakake phoenix ing njero aku. Swarga cemburu marang katresnan kita, malaekat nangis saka ndhuwur. Ya, sampeyan nggawa aku menyang utopia.
<div class="media">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
<p>Will you do the same for me? It's time to face the music I'm no longer your muse. Heard it's beautiful, be the judge and my girls gonna take a vote. I can feel a phoenix inside of me. Heaven is jealous of our love, angels are crying from up above. Yeah, you take me to utopia.</p>
</div>
</div>
Flexbug #12: Unsur inline ora dianggep minangka item fleksibel
Internet Explorer 10-11 ora nerjemahake unsur inline kaya pranala utawa gambar (utawa ::before
lan ::after
pseudo-elemen) minangka item fleksibel. Solusi mung kanggo nyetel nilai non-inline display
(contone, block
, inline-block
, utawa flex
). Disaranake nggunakake .d-flex
, salah siji saka utilitas tampilan kita , minangka fix gampang.
Sumber: Flexbugs ing GitHub
nyarang
Obyek media bisa disusun tanpa wates, sanajan disaranake sampeyan mandheg ing sawetara titik. Selehake nested .media
ing .media-body
obyek media induk.
Judhul media
Ngadeg ing garis ngarep nalika bom wiwit tiba. Swarga cemburu marang katresnan kita, malaekat nangis saka ndhuwur. Ora bisa ngganti sampeyan karo yuta dering. Cah, yen kowe karo aku, aku bakal menehi rasa. Ora bakal bali. Sadurunge sampeyan ketemu aku ora apa-apa, nanging kahanane rada abot. Abot iku sirah sing nganggo makutha.
Judhul media
Salam seduluran, ayo dolan. Ya, kita nggawe malaekat nangis, udan mudhun ing bumi saka ndhuwur. Menehi soko apik kanggo ngrameke. Aku mbiyen nggolet ilat lan ambegan. Aku ma njaluk racing atimu ing jins kulit-nyenyet sandi. Nalika aku mlaku dhewekan menyang beat sing beda. Summer sawise SMA nalika kita pisanan ketemu. Sampeyan pancen hipnotis, apa sampeyan bisa dadi setan? Apa sampeyan bisa dadi malaekat? Iku wektu kanggo nggawa metu balon gedhe. Panginten aku iki pangecualian. Bikinis, zucchinis, Martinis, ora weenies.
<div class="media">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
<p>Standing on the frontline when the bombs start to fall. Heaven is jealous of our love, angels are crying from up above. Can't replace you with a million rings. Boy, when you're with me I'll give you a taste. There’s no going back. Before you met me I was alright but things were kinda heavy. Heavy is the head that wears the crown.</p>
<div class="media mt-3">
<a class="mr-3" href="#">
<img src="..." alt="...">
</a>
<div class="media-body">
<h5 class="mt-0">Media heading</h5>
<p>Greetings loved ones let's take a journey. Yes, we make angels cry, raining down on earth from up above. Give you something good to celebrate. I used to bite my tongue and hold my breath. I'm ma get your heart racing in my skin-tight jeans. As I march alone to a different beat. Summer after high school when we first met. You're so hypnotizing, could you be the devil? Could you be an angel? It's time to bring out the big balloons. Thought that I was the exception. Bikinis, zucchinis, Martinis, no weenies.</p>
</div>
</div>
</div>
</div>
Alignment
Media ing obyek media bisa didadekake siji karo utilitas flexbox menyang ndhuwur (standar), tengah, utawa mburi .media-body
konten sampeyan.
Media sing didadekake ndhuwur
Aku bakal nggawe dheweke koma. Sampeyan menehi satus alasan, lan sampeyan ujar manawa sampeyan bakal nyoba. Mula aku lungguh meneng, sarujuk kanthi sopan. Cocog kanggo perang mahkotaku. Lan ing ulang tahun kaping 18, kita entuk tato sing cocog. Dadi très chic, ya, dheweke klasik. Aku siap kanggo dalan kurang lelungan.
Aku mlaku-mlaku ing udhara (wengi). Nanging mudhun menyang bumi. Sampeyan asli, ora bisa diganti. Nanging ing urip liyane aku bakal dadi prawan sampeyan. Kita ndamel menyang Cali lan mabuk ing pantai. Kita bisa nari, nganti mati, sampeyan lan aku, bakal enom ing salawas-lawase. Saw you downtown singing the Blues.
<div class="media">
<img src="..." class="align-self-start mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0">Top-aligned media</h5>
<p>I’m gon’ put her in a coma. You give a hundred reasons why, and you say you're really gonna try. So I sat quietly, agreed politely. Suiting up for my crowning battle. And on my 18th Birthday we got matching tattoos. So très chic, yeah, she's a classic. I am ready for the road less traveled.</p>
<p>I'm walking on air (tonight). But down to earth. You're original, cannot be replaced. But in another life I would be your girl. We drove to Cali and got drunk on the beach. We can dance, until we die, you and I, will be young forever. Saw you downtown singing the Blues.</p>
</div>
</div>
Media selaras tengah
Dheweke bakal dadi adhem kaya beku. Ing eh-mburi kabeh. Srengenge kaya tawon aku entuk belang. Bikinis, zucchinis, Martinis, ora weenies. Muga-muga sampeyan entuk napsu sing sehat. Kita bisa nari, nganti mati, sampeyan lan aku, bakal enom ing salawas-lawase. Kita lagi urip. Kita nindakake kanthi bener. Tembung ing dalan, sampeyan entuk apa-apa kanggo nuduhake aku, aku.
Kepengin ndeleng acara ing 3D, film. Jarene, wedi ora kaya wong liya, kekasih futuristik. Mbukak atimu. Mula aku lungguh meneng, sarujuk kanthi sopan. wingi malem jumat. Ya, sampeyan begja yen sampeyan ana ing pesawat dheweke. Aku bakal dadi hadiah sampeyan, menehi sing apik kanggo dirayakake.
<div class="media">
<img src="..." class="align-self-center mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0">Center-aligned media</h5>
<p>She'll turn cold as a freezer. At the eh-end of it all. Stinging like a bee I earned my stripes. Bikinis, zucchinis, Martinis, no weenies. I hope you got a healthy appetite. We can dance, until we die, you and I, will be young forever. We're living the life. We're doing it right. Word on the street, you got somethin' to show me, me.</p>
<p class="mb-0">Wanna see the show in 3D, a movie. They say, be afraid you're not like the others, futuristic lover. Open up your heart. So I sat quietly, agreed politely. Last Friday night. Yeah, you're lucky if you're on her plane. I'll be your gift, give you something good to celebrate.</p>
</div>
</div>
Media sing didadekake ngisor
Ayo, supaya werna sampeyan pecah. Aku bisa ngrasakake cahya sing ana ing njero aku. Sewengi padha dolanan, lagumu. Saka Tokyo menyang Meksiko, menyang Rio. Ora bakal bali. Nanging mudhun menyang bumi. Ajaib, warni, Pak Misteri, ee. Beda DNA, dheweke ora ngerti sampeyan.
Nanging mudhun menyang bumi. Dheweke duwe, je ne sais quoi, sampeyan ngerti. Aku bisa ndeleng tulisan ing tembok. Bocah-bocah patah gulu nyoba nyusup. Njupuk kula, ta-ta-njupuk kula. Mbukak atimu. Panginten aku iki pangecualian. Boom, boom, boom. Pantai Venice lan Palm Springs, musim panas iku kabeh. Nggawa beat maneh. (Iki carane kita nindakake)
<div class="media">
<img src="..." class="align-self-end mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0">Bottom-aligned media</h5>
<p>Come on, let your colours burst. I can feel this light that's inside of me. All night they're playing, your song. From Tokyo to Mexico, to Rio. There’s no going back. But down to earth. Magical, colorful, Mr. Mystery, ee. Different DNA, they don't understand you.</p>
<p class="mb-0">But down to earth. She's got that, je ne sais quoi, you know it. I can see the writing on the wall. The boys break their necks try'na to creep a little sneak peek. Take me, ta-ta-take me. Open up your heart. Thought that I was the exception. Boom, boom, boom. Venice beach and Palm Springs, summertime is everything. Bring the beat back. (This is how we do)</p>
</div>
</div>
dhawuh
Ngganti urutan isi ing obyek media kanthi ngowahi HTML dhewe, utawa nambah sawetara CSS flexbox khusus kanggo nyetel order
properti kasebut (kanggo integer sing sampeyan pilih).
Objek media
Aku ngerti bakal ana pengorbanan nanging iku regane. Apa kowe wani nglilani aku weruh merakmu? Dadi impen remaja sampeyan bengi iki. Uh-huh, aku weruh sampeyan. Ora bakal bali. Ya, kita maksimalake kertu kredit lan ditendhang metu saka bar. Dadi aku njaluk sampeyan nganggo setelan ulang tahun sampeyan. Sampeyan bisa uga tresna nalika ketemu dheweke. Wis donya ing telapak tangan. Aja nganti kamulyan sing gedhe, oh, oh ya. Saiki kita ngomong astrologi, njupuk kuku kita, kabeh Japanese-y. Gawe aku Aphrodite sampeyan.
<div class="media">
<div class="media-body">
<h5 class="mt-0 mb-1">Media object</h5>
<p>I know there will be sacrifice but that's the price. Are you brave enough to let me see your peacock? Be your teenage dream tonight. Uh-huh, I see you. There’s no going back. Yeah, we maxed our credit cards and got kicked out of the bar. So let me get you in your birthday suit. You may fall in love when you meet her. Had the world in the palm of your hands. Don't let the greatness get you down, oh, oh yeah. Now we talking astrology, getting our nails did, all Japanese-y. Make me your Aphrodite.</p>
</div>
<img src="..." class="ml-3" alt="...">
</div>
Dhaptar media
Amarga obyek media duwe sawetara syarat struktural, sampeyan uga bisa nggunakake kelas kasebut ing dhaptar unsur HTML. Ing <ul>
utawa <ol>
, tambahake .list-unstyled
kanggo mbusak gaya dhaptar standar browser, banjur aplikasi .media
menyang <li>
s. Kaya biasane, gunakake utilitas spasi ing endi wae sing dibutuhake kanggo nyetel.
-
Objek media adhedhasar dhaptar
Kabeh bocah-bocah wadon Chanel vintage. Dadi sampeyan bisa duwe kue. Bengi iki, bengi iki, aku mlaku-mlaku ing udara. Alon-alon nguntal rasa wediku, ya. Tuwuh kanthi cepet dadi kilat. Dadi panas lan abot, 'Til esuke. Dongeng kasebut dipungkasi karo ksatria nganggo waja sing mencorong. Abot iku sirah sing nganggo makutha.
-
Objek media adhedhasar dhaptar
Mungkin alesan kenapa kabeh lawang ditutup. Amarga yen sampeyan dadi duwekku, yen sampeyan dadi duwekku. Dadi impen remaja sampeyan bengi iki. Abot iku sirah sing nganggo makutha. Iki dudu preian, ora ana sing dirayakake. Badai sampurna, badai sampurna.
-
Objek media adhedhasar dhaptar
Apa kowe wani nglilani aku weruh merakmu? Ora bakal bali. Iki pungkasan sampeyan ngomong, sawise baris pungkasan sampeyan break. Ing eh-mburi kabeh.
<ul class="list-unstyled">
<li class="media">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0 mb-1">List-based media object</h5>
<p>All my girls vintage Chanel baby. So you can have your cake. Tonight, tonight, tonight, I'm walking on air. Slowly swallowing down my fear, yeah yeah. Growing fast into a bolt of lightning. So hot and heavy, 'Til dawn. That fairy tale ending with a knight in shining armor. Heavy is the head that wears the crown.</p>
</div>
</li>
<li class="media my-4">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0 mb-1">List-based media object</h5>
<p>Maybe a reason why all the doors are closed. Cause once you’re mine, once you’re mine. Be your teenage dream tonight. Heavy is the head that wears the crown. It's not even a holiday, nothing to celebrate. A perfect storm, perfect storm.</p>
</div>
</li>
<li class="media">
<img src="..." class="mr-3" alt="...">
<div class="media-body">
<h5 class="mt-0 mb-1">List-based media object</h5>
<p>Are you brave enough to let me see your peacock? There’s no going back. This is the last time you say, after the last line you break. At the eh-end of it all.</p>
</div>
</li>
</ul>