我想在html中创建一个矩形,并在其上放置一些文本。当单击该矩形时,它应该重定向到另一页。
您应该使用带有显示设置的标签:
a {
display: inline-block;
height: 50px; /*sets height of element*/
background: cornflowerblue; /*sets the background of this element (here a solid colour)*/
transition: all 0.6s; /*sets a transition (for hover effect)*/
padding-left: 20px; /*sets 'padding'*/
padding-right: 20px; /*sets 'padding'*/
line-height: 50px; /*for this, it sets vertical alignment*/
}
a:hover {
background: tomato; /*sets background colour*/
}
<a href="#">Some Text</a>
在href
属性内,应将链接放置到下一页:
<a href="/Home/NextPageDirectory">Link Text</a>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句