ironheartbj18 Posted April 15, 2014 Share Posted April 15, 2014 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: url("https://codecademy-content.s3.amazonaws.com/courses/web-beginner-en-3pc6w/images/splash.jpg"); 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> <img src= "https://codecademy-content.s3.amazonaws.com/courses/web-beginner-en-3pc6w/images/avatar.jpg" height="250" width="250"> <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"> <img src= "http://seanheritage.com/wp-content/uploads/2013/05/success.jpg" height = "250" width="250"> </body> Link to comment Share on other sites More sharing options...
newseed Posted April 15, 2014 Share Posted April 15, 2014 if you are referring to the avatar image then use margin: 0 auto; Link to comment Share on other sites More sharing options...
dsonesuk Posted April 15, 2014 Share Posted April 15, 2014 (edited) 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 April 15, 2014 by dsonesuk Link to comment Share on other sites More sharing options...
ironheartbj18 Posted April 16, 2014 Author Share Posted April 16, 2014 oh thats right thanks for your feedback! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now