+ 4
How to put a picture at the center of the screen
8 odpowiedzi
+ 8
Use this code : <p align="center"><img src="myimage.jpg"></p> .. This will help :) .. Please do upvote if you got your answer
+ 7
align="center"
valign="middle"
+ 4
#test{
display:block;
margin-right:auto;
margin-left:auto;
}
+ 4
<!DOCTYPE html>
<html>
<style>
#test{
display:block;
margin-right:auto;
margin-left:auto;
}
</style>
<head>
<title>Page Title</title>
</head>
<body>
<img src="test.jpg" alt="" id="test">
</body>
</html>
+ 4
Align=center works but people are now moving to using CSS instead of align=center. The reason I suggest CSS is because align=center might not work on some browser in the future.
+ 4
Just use margin: auto; in CSS, you could also go with the margin-left: auto; and margin-right: auto; that everyone else is saying, they both work pretty much the same.
+ 4
I couldnt get it to work unless u make it a block element.
+ 3
Where I put this