请问这种样式不用图片怎么实现,宽度自适应,谢谢!
如图:
补充一下,右边是封闭的,那个图不知道怎么放上去右边没有了:(
用绝对定位吧,将文字那块定位到框框上面就可以了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#all{ margin:20px auto; width:960px;}#panel{ border:#09F 1px solid; position:relative; width:600px;}#title{ position:absolute; left:20px; top:-15px; background:#FFF; padding:5px 10px;}</style></head><body><div id="all"><div id="panel"><div id="title">基本信息</div><p>内容</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/1456">
<img src="https://img.php.cn/upload/ai_manual/001/431/639/68b6cba49740f148.png" alt="改图鸭AI图片生成">
</a>
<div class="aritcle_card_info">
<a href="/ai/1456">改图鸭AI图片生成</a>
<p>改图鸭AI图片生成</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="改图鸭AI图片生成">
<span>30</span>
</div>
</div>
<a href="/ai/1456" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="改图鸭AI图片生成">
</a>
</div>
</div></div></body></html> nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
感谢各位,用#4楼 bigc2001的方式很好!简单!谢谢!
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号