I got this exact question in an email the other day, and I thought it would make a nice blog post because of how wonderfully satisfying this is to do in CSS these days. Plus we can sprinkle in polish to it as we go.
HTML-wise, I’m thinking image, text, image, text, etc.
<img src="/static/imghwm/default1.png" data-src="您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?" class="lazy" alt="您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?" height="" style="max-width:90%"> <p>Text text text您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?</p> <img src="/static/imghwm/default1.png" data-src="您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?" class="lazy" alt="您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?" height="" style="max-width:90%"> <p>Text text text您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?</p> <img src="/static/imghwm/default1.png" data-src="您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?" class="lazy" alt="您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?" height="" style="max-width:90%"> <p>Text text text您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?</p>
If that was our entire body in an HTML document, the answer to the question in the blog post title is literally two lines of CSS:
body { display: grid; grid-template-columns: min-content 1fr; }
It’s going to look something like this…
So cool. Thanks CSS. But let’s clean it up. Let’s make sure there is a gap, set the default type, and reign in the layout.
body { display: grid; padding: 2rem; grid-template-columns: 300px 1fr; gap: 1rem; align-items: center; max-width: 800px; margin: 0 auto; font: 500 100%/1.5 system-ui; } img { max-width: 100%; height: auto; }
I mean… ship it, right? Close, but maybe we can just add a quick mobile style.
@media (max-width: 650px) { body { display: block; font-size: 80%; } p { position: relative; margin: -3rem 0 2rem 1rem; padding: 1rem; background: rgba(white, 0.8); } }
OK, NOW ship it!
以上是您如何製作一個圖片,並在頁面的一側與另一側的段落相匹配?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

CSSCOUNTERSAREDOMANAGEAUTOMANAMBERINGINWEBDESIGNS.1)他們可以使用forterablesofcontents,ListItems,and customnumbering.2)AdvancedsincludenestednumberingSystems.3)挑戰挑戰InclassINCludeBrowsEccerCerceribaliblesibility andperformiballibility andperformissises.4)創造性

使用滾動陰影,尤其是對於移動設備,是克里斯以前涵蓋的一個微妙的UX。傑夫(Geoff)涵蓋了一種使用動畫限制屬性的新方法。這是另一種方式。

文章討論了CSS FlexBox,這是一種佈局方法,用於有效地對齊和分佈響應設計中的空間。它說明了FlexBox用法,將其與CSS網格進行了比較,並詳細瀏覽了瀏覽器支持。

本文討論了使用CSS創建響應網站的技術,包括視口元標籤,靈活的網格,流體媒體,媒體查詢和相對單元。它還涵蓋了使用CSS網格和Flexbox一起使用,並推薦CSS框架

本文討論了CSS盒裝屬性,該屬性控制了元素維度的計算方式。它解釋了諸如Content-Box,Border-Box和Padding-Box之類的值,以及它們對佈局設計和形式對齊的影響。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

禪工作室 13.0.1
強大的PHP整合開發環境

記事本++7.3.1
好用且免費的程式碼編輯器

Dreamweaver Mac版
視覺化網頁開發工具

WebStorm Mac版
好用的JavaScript開發工具

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。