在.jsp页面中,我想把Lv写在图片左上角,球员位置写在右上角,人名写在图片左下角。但是现在文字位置不知道为什么有问题?应该怎么办?代码、图片如下。
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Cards Page</title></head><body> <c:forEach items="${cardItems }" var="pci" varStatus="status"> <div style="width: 139px; white-space: nowrap; float: left;"> <a href="${pageContext.request.contextPath }/card/viewCardDetails/${pci.playerCardItemId }"><img src="/static/imghwm/default1.png" data-src="<c:out value=" class="lazy" style="max-width:90%" alt="" ${pageContext.request.contextPath }/${pci.playerCard.player.url }" />"></a> <label style="position: relative; top:-10px; left:-145px;"><font style="font-weight: bold;"><c:out value="${pci.playerCard.player.name }"></c:out></font></label> <label style="position: relative; top:-170px; left:-135px;"><font style="font-weight: bold;"><c:out value="${pci.playerCard.player.position.abbreviation }"></c:out></font></label> <label style="position: relative; top:-170px; left:-250px;"><font style="font-weight: bold;">Lv<c:out value="${pci.potentiality }"></c:out></font></label> </div> </c:forEach></body></html>
回复讨论(解决方案)
label属性设置为absolute,使用绝对定位,定个各个标签的位置
@DaveLeeCN 结果所有的Lv、球员位置、人名都堆到一块了。请注意,我的代码里有个for循环,这些图片是for循环出来的,结果不对是不是和这个有关?
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title> Cards Page</title></head><body> <c:forEach items="${cardItems }" var="pci" varStatus="status"> <div style="width: 139px; white-space: nowrap; float: left;"> <a href="${pageContext.request.contextPath }/card/viewCardDetails/${pci.playerCardItemId }"><img src="/static/imghwm/default1.png" data-src="<c:out value=" class="lazy" style="max-width:90%" alt="" ${pageContext.request.contextPath }/${pci.playerCard.player.url }" />"></a> <label style="position: absolute; bottom:0px; left:0px;"><font style="font-weight: bold;"><c:out value="${pci.playerCard.player.name }"></c:out></font></label> <!-- <label style="position: relative; top:-170px; left:-145px;"><c:out value="${pci.playerCard.player.number }"></c:out></label> --> <label style="position: absolute; top:0px; right:0px;"><font style="font-weight: bold;"><c:out value="${pci.playerCard.player.position.abbreviation }"></c:out></font></label> <label style="position: absolute; top:0px; left:0px;"><font style="font-weight: bold;">Lv<c:out value="${pci.potentiality }"></c:out></font></label> </div> </c:forEach></body></html>
定位。相对定位。

HTML是一种用于构建网页的语言,通过标签和属性定义网页结构和内容。1)HTML通过标签组织文档结构,如、。2)浏览器解析HTML构建DOM并渲染网页。3)HTML5的新特性如、、增强了多媒体功能。4)常见错误包括标签未闭合和属性值未加引号。5)优化建议包括使用语义化标签和减少文件大小。

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

HTML的作用是通过标签和属性定义网页的结构和内容。1.HTML通过到、等标签组织内容,使其易于阅读和理解。2.使用语义化标签如、等增强可访问性和SEO。3.优化HTML代码可以提高网页加载速度和用户体验。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代码” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代码”代码“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web开发的三大支柱。1.HTML定义网页结构,使用标签如、等。2.CSS控制网页样式,使用选择器和属性如color、font-size等。3.JavaScript实现动态效果和交互,通过事件监听和DOM操作。

HTML定义网页结构,CSS负责样式和布局,JavaScript赋予动态交互。三者在网页开发中各司其职,共同构建丰富多彩的网站。

HTML适合初学者学习,因为它简单易学且能快速看到成果。1)HTML的学习曲线平缓,易于上手。2)只需掌握基本标签即可开始创建网页。3)灵活性高,可与CSS和JavaScript结合使用。4)丰富的学习资源和现代工具支持学习过程。

AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

Dreamweaver Mac版
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

SublimeText3 Linux新版
SublimeText3 Linux最新版

WebStorm Mac版
好用的JavaScript开发工具

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。