Wordpress divi HTML内嵌图片
如何将两张图片相邻放置?我必须使用CSS还是可以使用HTMLWordpress divi HTML内嵌图片,html,css,wordpress,Html,Css,Wordpress,如何将两张图片相邻放置?我必须使用CSS还是可以使用HTML <!DOCTYPE html> <html> <style> a:link { color: #D83F33; background-color: transparent; text-decoration: none; } a:visited { color: #D83F33; background-color: transparent; text-decoration:
<!DOCTYPE html>
<html>
<style>
a:link { color: #D83F33; background-color: transparent; text-decoration: none; }
a:visited { color: #D83F33; background-color: transparent; text-decoration: none; }
a:hover { color: #D83F33; background-color: transparent; text-decoration: underline; }
a:active { color: #D83F33; background-color: transparent; text-decoration: underline; }
</style>
<div align="center">
<div class=nav1">
<img src="https://reflex-jam.nl/wp-content/uploads/2017/04/Bootcamp-tekst.jpg" alt="E-Sportkleding" />
<p> <a href="https://www.e-sportkleding.nl/html/" target="_blank" style="D83F33">E-sportkleding</a> </p>
<img src="https://www.trias-groep.nl/wp-content/uploads/2014/07/logo_norm.png" alt="Trias" />
<p> <a href="http://www.trias-groep.nl" target="_blank" style="D83F33">Trias jeugdhulp</a> </p>
</div>
</html>
</div>
a:链接{color:#D83F33;背景色:透明;文本装饰:无;}
a:已访问{颜色:#D83F33;背景色:透明;文本装饰:无;}
a:悬停{color:#D83F33;背景色:透明;文本装饰:下划线;}
a:活动{color:#D83F33;背景色:透明;文本装饰:下划线;}
将您的img
和p
包装在另一个div
中,如下所示:
<div class="nav1">
<div>
<img src="https://reflex-jam.nl/wp-content/uploads/2017/04/Bootcamp-tekst.jpg " alt="E-Sportkleding " />
<p> <a href="https://www.e-sportkleding.nl/html/ " target="_blank " style="D83F33 ">E-sportkleding</a> </p>
</div>
<div>
<img src="https://www.trias-groep.nl/wp-content/uploads/2014/07/logo_norm.png " alt="Trias " />
<p> <a href="http://www.trias-groep.nl " target="_blank " style="D83F33 ">Trias jeugdhulp</a> </p>
</div>
</div>
请修改html/css,如下面的代码段,以便将图片彼此相邻,将img&p放在div中。请参见下面的代码段,其中我在.nav1中编辑了html并添加了css,以获得所需的结果。
a:link{color:#D83F33;背景色:透明;文本装饰:无;}
a:已访问{颜色:#D83F33;背景色:透明;文本装饰:无;}
a:悬停{color:#D83F33;背景色:透明;文本装饰:下划线;}
a:活动{color:#D83F33;背景色:透明;文本装饰:下划线;}
.nav1{显示:内联块;填充:10px;文本对齐:居中;}
有效,但如何在它们之间留出更多的空间?@BrianSol您可以在.nav1 div{}中添加边距。我已经编辑了它,当您检查代码片段时,很容易获得我在html/css中修改的内容,因此不需要在那里进行解释。谢谢:)
.nav1 div {
display: inline-block;
margin: 0 10px;
}