简体   繁体   English

HTML5-在其图像旁边放置h1文本

[英]HTML5 - position h1 text next its image

I'm trying to put in an HEADER tag a H1 tag next to a logo image as below: 我试图在HEADER标签中的徽标图片旁边放置一个H1标签,如下所示:

 /* line 1, ../scss/layout/_header.scss */ header { background: white; color: red; height: 100px; } header img.logoImage{ width:30px; height:30px; } /* line 6, ../scss/layout/_header.scss */ header h1#companyName { padding: 20px; font-size: 20px; } /* line 10, ../scss/layout/_header.scss */ header h1#companyName a .logoImage { } 
  <header> <h1 id="companyName"> <a href="#" title="Company Website"> <img class="logoImage" title="" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSd51Q5z8j6c_EBEYzZgU1pfyiGHxOUgchpUs9wC3eaFn6PrXfqe8kjWA" alt="Company Name"/> Company name </a> </h1> </header> 

The thing is that "Some title" is not showing as it stays underneath the image. 问题是“ Some title”没有显示,因为它停留在图像下方。 Also, is this a good way to implement it? 另外,这是实现它的好方法吗? (SEO etc etc) (SEO等)

Could you please shed some light on it? 您能说明一下吗?

Thanks! 谢谢!

您可以在选择器之后尝试使用CSS:

.logoImage:after { content:attr(alt);}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM