objék média
Dokuméntasi sareng conto pikeun objék média Bootstrap pikeun ngawangun komponén anu repetitive pisan sapertos koméntar blog, tweet, sareng anu sanésna.
Contona
Objek média mantuan ngawangun komponén kompléks jeung repetitive dimana sababaraha media diposisikan barengan eusi nu teu mungkus sabudeureun éta média. Tambih Deui, éta ngalakukeun ieu ngan ukur dua kelas anu diperyogikeun berkat flexbox.
Di handap ieu conto hiji objek média tunggal. Ngan ukur dua kelas anu diperyogikeun - bungkus .media
sareng .media-body
eusi anjeun. Padding sareng margin pilihan tiasa dikontrol ku utilitas jarak .
Judul média
Dupi anjeun ngalakukeun hal nu sarua pikeun kuring? Waktosna pikeun nyanghareupan musik Abdi henteu deui muse anjeun. Kadéngé éta geulis, jadi hakim jeung katresna kuring gonna nyokot sora. Abdi tiasa ngaraos phoenix di jero kuring. Sawarga cemburu cinta urang, malaikat ceurik ti luhur. Leres, anjeun nyandak kuring ka 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 henteu dianggap salaku barang anu fleksibel
Internet Explorer 10-11 henteu ngajantenkeun elemen inline sapertos tautan atanapi gambar (atanapi ::before
sareng ::after
unsur pseudo) salaku barang anu fleksibel. Hiji-hijina jalan pikeun ngeset nilai non-inline display
(contona, block
, inline-block
, atawa flex
). Kami nyarankeun ngagunakeun .d-flex
, salah sahiji utilitas tampilan urang , salaku fix gampang.
Sumber: Flexbugs dina GitHub
Nyarang
Obyék média tiasa disarangkeun tanpa wates, sanaos kami nyarankeun anjeun lirén dina sababaraha waktos. Tempat disarangkeun .media
dina .media-body
objék média indungna.
Judul média
Nangtung dina frontline nalika bom mimiti ragrag. Sawarga cemburu cinta urang, malaikat ceurik ti luhur. Teu tiasa ngagentos anjeun ku sajuta cincin. Budak, nalika anjeun sareng abdi, abdi bakal masihan anjeun rasa. Moal aya nu balik. Sateuacan anjeun pendak sareng kuring, kuring henteu kunanaon tapi hal-hal éta beurat. Beurat sirah anu ngagem makuta.
Judul média
Salam sayang hayu urang jalan-jalan. Leres, urang ngadamel malaikat ceurik, hujan turun ka bumi ti luhur. Masihan anjeun hal alus pikeun ngagungkeun. Abdi biasa ngegel létah sareng nahan napas. Abdi ma meunang balap haté anjeun dina jeans kulit-kedap kuring. Nalika kuring leumpang nyalira pikeun neunggeul anu béda. Summer sanggeus SMA nalika urang munggaran patepung. Anjeun jadi hipnotis, anjeun bisa jadi Iblis? Naha anjeun tiasa janten malaikat? Geus waktuna pikeun ngaluarkeun balon gedé. Panginten kuring éta iwal. Bikinis, zucchinis, Martinis, euweuh 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>
Ngajajar
Média dina obyék média tiasa disaluyukeun sareng utilitas flexbox ka luhur (standar), tengah, atanapi tungtung .media-body
eusi anjeun.
média Top-Blok
Abdi badé nempatkeun anjeunna dina koma. Anjeun masihan saratus alesan kunaon, sareng anjeun nyarios anjeun badé nyobian. Ku kituna kuring diuk quietly, sapuk sopan. Cocog pikeun perang mahkota kuring. Sareng dina ulang taun ka-18 kuring ngagaduhan tato anu cocog. Janten très chic, nuhun, anjeunna klasik. Kuring geus siap pikeun jalan kirang ngumbara.
Abdi leumpang dina hawa (wengi). Tapi turun ka bumi. Anjeun asli, teu tiasa diganti. Tapi dina kahirupan anu sanés kuring bakal janten awéwé anjeun. Urang drove mun Cali sarta meunang mabok on pantai. Urang bisa nari, nepi ka urang maot, anjeun jeung kuring, bakal ngora salawasna. Ningali anjeun tengah kota nyanyi 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>
Média puseur-Blok
Anjeunna bakal tiis sapertos freezer. Dina éh-tungtung éta sadayana. Nyeureud kawas nyiruan kuring earned stripes kuring. Bikinis, zucchinis, Martinis, euweuh weenies. Mugia sing sehat napsu. Urang bisa nari, nepi ka urang maot, anjeun jeung kuring, bakal ngora salawasna. Urang hirup hirup. Kami ngalakukeun éta leres. Kecap di jalan, anjeun ngagaduhan hal anu nunjukkeun ka kuring, kuring.
Hoyong ningali acara dina 3D, pilem. Maranéhanana ngomong, sieun anjeun teu kawas batur, lover futuristik. Buka haté anjeun. Ku kituna kuring diuk quietly, sapuk sopan. Jumat wengi terahir. Hehehehe, anjeun untung mun anjeun dina pesawat nya. Abdi bakal janten kado anjeun, masihan anjeun anu saé pikeun ngagungkeun.
<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>
Média handap-blok
Hayu, hayu warna anjeun burst. Abdi tiasa ngaraosan cahaya ieu anu aya di jero kuring. Sapeuting aranjeunna nuju maén, lagu anjeun. Ti Tokyo ka Mexico, ka Rio. Moal aya nu balik. Tapi turun ka bumi. Sakti, warni, Tuan Misteri, ee. DNA anu béda, aranjeunna henteu ngartos anjeun.
Tapi turun ka bumi. Anjeunna ngagaduhan éta, je ne sais quoi, anjeun terang éta. Abdi tiasa ningali tulisan dina témbok. Jajaka megatkeun beuheung maranéhanana try'na ngarayap saeutik sneak ngintip. Candak abdi, ta-ta-nyandak kuring. Buka haté anjeun. Panginten kuring éta iwal. Boom, boom, boom. Pantai Venice sareng Palm Springs, usum panas mangrupikeun sadayana. Bawa ngagebug deui. (Ieu kumaha urang ngalakukeun)
<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>
pesenan
Ngarobah urutan eusi dina objék média ku modifying HTML sorangan, atawa ku nambahkeun sababaraha custom flexbox CSS pikeun ngeset order
harta (ka integer milih anjeun).
objék média
Kuring terang bakal aya pengorbanan tapi éta hargana. Naha anjeun wani ngantepkeun kuring ningali merak anjeun? Janten impian rumaja anjeun wengi ayeuna. Uh-huh, kuring ningali anjeun. Moal aya nu balik. Leres, urang maksimalkeun kartu kiridit sareng ditajong kaluar tina bar. Janten hayu atuh kéngingkeun anjeun dina jas ulang taun anjeun. Anjeun bisa murag asih mun anjeun papanggih manehna. Kungsi dunya dina dampal leungeun anjeun. Tong dugikeun kaagungan anjeun turun, oh, oh hehehehe. Ayeuna urang ngobrol astrologi, meunang kuku urang, sadayana Jepang-y. Jadikeun kuring Aphrodite Anjeun.
<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>
Daptar média
Kusabab obyék média gaduh sakedik syarat struktural, anjeun ogé tiasa nganggo kelas ieu dina daptar elemen HTML. Dina anjeun <ul>
atanapi <ol>
, tambahkeun .list-unstyled
pikeun miceun sagala gaya daptar standar browser, lajeng dilarapkeun .media
ka <li>
s Anjeun. Sapertos biasa, anggo utilitas jarak dimana waé diperyogikeun pikeun nyaluyukeun.
-
Objek média dumasar daptar
Sadayana budak awéwé Chanel vintage kuring. Janten anjeun tiasa gaduh jajan anjeun. Peuting ayeuna, wengi ayeuna, kuring leumpang dina hawa. Lalaunan ngelek sieun kuring, hehehehe. Tumuwuh gancang jadi kilat. Jadi panas jeung beurat, 'Til subuh. Éta dongéng ditungtungan ku satria dina waja bersinar. Beurat sirah anu ngagem makuta.
-
Objek média dumasar daptar
Meureun alesan naha sakabéh panto ditutup. Cukang lantaran sakali anjeun milik kuring, sakali anjeun milik kuring. Janten impian rumaja anjeun wengi ayeuna. Beurat sirah anu ngagem makuta. Ieu malah teu libur, euweuh pikeun ngagungkeun. Badai sampurna, badai sampurna.
-
Objek média dumasar daptar
Naha anjeun wani ngantepkeun kuring ningali merak anjeun? Moal aya nu balik. Ieu panungtungan waktu anjeun nyebutkeun, sanggeus garis panungtungan anjeun megatkeun. Dina éh-tungtung éta sadayana.
<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>