如何将链接元素的位置设置到标题的底部?
header { height: 200px; wIDth: 100%; padding-left: 500px; background-color: grey; border-bottom: solID blue 6px;}a { display: block; float: left; wIDth: 125px; height: 50px; border: solID blue 2px; padding-left: 2px; border-radius: 15px 15px 0px 0px; text-align: center; line-height: 50px; color: white; background-color: black;}
<header> <a href="#home">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> <a href="#about">About</a></header>
我试图设定最低点:0;但没有结果.我也尝试了margin-top和padding-top,但是结果是标题的高度不同.如果我将边距或填充设置为200px,则标题会提高200px.最佳答案只需将header的CSS编辑为:
header{ height: 200px; wIDth: 100%; padding-left: 500px; background-color: grey; border-bottom: solID blue 6px; display: flex; flex-direction: row; justify-content: center; align-items: flex-end; }a { display: block; float: left; wIDth: 125px; height: 50px; border: solID blue 2px; padding-left: 2px; border-radius: 15px 15px 0px 0px; text-align: center; line-height: 50px; color: white; background-color: black;}
<header> <a href="#home">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> <a href="#about">About</a></header>
总结 以上是内存溢出为你收集整理的html-如何设置标题内链接的底部位置 全部内容,希望文章能够帮你解决html-如何设置标题内链接的底部位置 所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)