抱歉,如果我在这里做错了什么,我对编码和这个网站有点陌生。
总之,就这样吧
我想在我的网站顶部居中“ Logo ”的左侧和右侧植入广告。但是,标题 Logo 充当文本大小整行的链接,这使得无法实现/无法点击广告。
这是标题行
<div class="container">
<a href="/index.html" style="text-decoration: none"><div style="font-family: Conv_5STAR_League; font-size:20px"><h1
align="center"><span style="color:gold">LoL</span><span
style="color:white">Chromas</span></h1></div></a>
<div style="text-align: center"><img src="./Aatrox Chromas_files/SYozsnx.png" alt="Aatrox"; style= "width= 150"></div>
<h1 class="strokeme" style="text-align: center; font-family: Conv_5STAR_League;color: white">Aatrox</h1>
我真的很感激我能得到的任何帮助,即使这是一个“菜鸟”问题,如前所述,我对此仍然很陌生,无法在谷歌上找到解决方案
谢谢大家,致以最诚挚的问候
最佳答案
div
- 一个占据 100% 宽度的 block 元素,可点击链接也是如此
为什么要使用额外的标记——你可以轻松做到
h1{
text-align: center;
font-family: Conv_5STAR_League;
font-size:20px
}
<div class="container">
<h1><a href="/index.html" class="" style="text-decoration: none"><span style="color:gold">LoL</span><span
style="color:white">Chromas</span></a>
</h1>
<div style="text-align: center"><img src="./Aatrox Chromas_files/SYozsnx.png" alt="Aatrox"; style= "width= 150"></div>
<h1 class="strokeme" style="text-align: center; font-family: Conv_5STAR_League;color: white">Aatrox</h1>
关于html - 整个标题行充当链接,而不仅仅是文本所在的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30152044/