Jump to content

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>
{text-align: center;
text-align: center;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
color: white;
font-size: 24px;
input[type=submit] {
background: limegreen;
color: black;
p {
font-size: 24px;
border: 0;
padding: 12px;
font-size: 18px;
<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">


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
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.

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.

  • Create New...