In the JSP, let the picture be centered in the Div, as shown above
Example:
Copy Code code as follows:
CSS file
<style type= "Text/css" >
#bj {
width:200px;
height:200px;
BORDER:3PX solid red;
Text-align:center;
Vertical-align:middle;
Display:table-cell; Display an object as a table cell
Background:pink;
}
img{
width:150px;
height:150px;
margin:0 Auto;
Vertical-align:middle;
BORDER:2PX solid Green;
}
</style>
Body file
<body>
<div id= "BJ" >
</div>
</body>
If in the HTML, there will be that effect on the diagram, the picture is centered, but the picture in the JSP only horizontally centered, in this case, we need to
Copy Code code as follows:
<! Doctype> to join the standard statement of the consortium, such as:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Add to the JSP in the picture will be the center of the wish!