Home >Web Front-end >HTML Tutorial >A button is embedded in the link tag in jsp. The css of the button is to introduce an image. How to make the button appear vertically centered_html/css_WEB-ITnose

A button is embedded in the link tag in jsp. The css of the button is to introduce an image. How to make the button appear vertically centered_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 11:47:371800browse

A button is embedded in the link tag in jsp. The css of the button is to introduce an image. How to make the button appear vertically centered? ?
The question is how to center the button vertically? ? Now vertically on top
Here is the current code.

<a href="" ><input type="button"  id="login"  value=""></a>

Here is what the problem looks like now


Reply to discussion (solution)

Picture Relative positioning, or direct padding-top:10px;

Your text needs to be moved down. . The style introduces the picture: background:url(......) center center no-repeat; it is centered on the left, right, top and bottom

Why do you put input in the a tag?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn