Jump to content

how make two center img src ?


ironheartbj18

Recommended Posts

hello everyone i am new to this w3 this must be very exciting.

I have question about the html code. How do you make the "second img src" move to the center?

 

I am giving you the example the code...

 

 

<!DOCTYPE html>
<head>
<style>
body
{text-align: center;
text-align: center;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
color: white;
font-family:Helvetica;
font-size: 24px;
}
input[type=submit] {
background: limegreen;
color: black;
}
p {
font-size: 24px;
color:black;
background:white;
font-family:Arial;
}
input{
border: 0;
padding: 12px;
font-size: 18px;
}
</style>
</head>
<body>
<p> Hi! I am learning how to make
my very own web page!
I really like
blueberry muffins and long walks on
the beach.</p>
<input type="email" placeholder="Email">
<input type="submit">
</body>

post-172635-0-97761800-1397586918_thumb.png

Link to comment
Share on other sites

But! first you would have to turn it into a block element (display: block;) because by default img elements are inline, and margin: 0 auto; does not work on inline elements.

 

OR you could just put a line break before the image to force it on a new line, and let text-align: center; that you already have centre it.

<br> <img src= "http://seanheritage.com/wp-content/uploads/2013/05/success.jpg" height = "250" width="250" alt="">
Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...