我们用一幅图来展示实际的应用场景:
perfect.png
分析:
代码结构
<p>文本</p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/cb6835dc7db1" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">前端免费学习笔记(深入)</a>”;</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/854">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679978251103.png" alt="腾讯元宝">
</a>
<div class="aritcle_card_info">
<a href="/ai/854">腾讯元宝</a>
<p>腾讯混元平台推出的AI助手</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="腾讯元宝">
<span>223</span>
</div>
</div>
<a href="/ai/854" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="腾讯元宝">
</a>
</div>
<figure> <img src="" alt="" style="max-width:90%" height="" /> <figcaption>标题/描述</figcaption></figure><p>文本</P>为了得到正确的宽度,我们给 figure 元素浮动,但却引发了新的问题,整个布局模式改变了
float.png
inline-block.png
figure { max-width: 502px; max-width: min-content; margin: 20px auto;}figure > img { max-width: inherit;}说明:
《CSS SECRETS》
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号