- Use CSS to set a fixed width on the image of 800 pixels, and center it in the window horizontally.
img { display: block; /* img is normally inline and need to change to block to center on page width: 800px; margin: 0 auto; }
- Using the code from the previous problem, change the width property for img to 100%, and set the max-width property to 800px. The image should expand to fit any container width up to 800 pixels. Resize your browser width and watch how that affects the photograph.