Jump to content
ironheartbj18

how make two center img src ?

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...