gpt4 book ai didi

javascript - 图像上的隐形边框

转载 作者:太空宇宙 更新时间:2023-11-03 20:45:58 25 4
gpt4 key购买 nike

我正在尝试将我的 10 张随机图像稍微分开,这样它们就不会被压在一起。我尝试使用边框,但没有收到任何错误,只是它不起作用。我正在尝试使用边框作为填充,因此它必须是不可见的并且只能在左侧和右侧。有帮助吗?

<html>
<head>
<title>Cards</title>
<script type="text/css">
.cardPad{
border-top:none;
border-bottom:none;
border-left:10px;
border-right:10px;
}
</script>
</head>
<body>
<p>
<?php
$cards = array("Messi", "Ronaldo", "Ibrahimovic", "Ribery", "Robben", "Neymar", "Rooney", "Casillas", "Falcao", "Van Persie", "Hazard", "Iniesta", "Xavi", "Schweinsteiger", "Silva", "Fabregas", "Lahm", "Aguero", "Cavani", "Vidic", "Ozil", "Mata", "Bale", "ThiagoSilva", "Kompany", "Tevez", "Toure", "Ramos", "Suarez", "Pirlo", "DiMaria", "Neuer", "Pique", "Buffon", "Lewandowski", "Gomez", "Chiellini", "Cole", "Pedro", "Busquets", "Cech", "Muller", "Hummels", "Alonso", "Navas", "Modric", "Cazorla", "Gotze", "Benzema", "Vidal", "Lavezzi");

shuffle($cards);

$cards = array_slice($cards, 0, 10);

foreach ($cards as $card) {
echo "<img class='cardPad' src='http://d2bm3ljpacyxu8.cloudfront.net/fit/105x97/http://clearpkz.webs.com/webstore/$card.png'>";
}
?>
</p>
</body>
</html>

最佳答案

我为此创建了一个 jsfiddle,是 this你想要什么?

实际上,你可以使用marginpadding将这些分开 <img>秒。我不明白为什么你不能让它工作。

您可能需要发布修改后的代码以便我们提供帮助。

关于javascript - 图像上的隐形边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20930505/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com