freeCodeCamp's Center an Element Horizontally Using the margin Property, Applied Visual Design VIDEO
Learning to center an element using the margin property is an important tool to have access to in your toolset. Using the margin property and giving it a value of "auto" will center our element horizontally. We can apply these same settings to images. Since images are inline elements, we would also need to change the image's display property to block.
Other Videos By We Will Code 2018-09-27 freeCodeCamp's Use the CSS Transform scale Property to Scale an Element on Hover 2018-09-27 freeCodeCamp's Use the CSS Transform scale Property to Change the Size of an Element 2018-09-26 freeCodeCamp's Create Texture by Adding a Subtle Pattern as a Background Image, url function 2018-09-25 freeCodeCamp's Use a CSS Linear Gradient to Create a Striped Element 2018-09-24 freeCodeCamp's Create a Gradual CSS Linear Gradient, Applied Visual Design 2018-09-22 freeCodeCamp's Adjust the Tone of a Color, Applied Visual Design 2018-09-22 freeCodeCamp's Adjust the Hue of a Color, Applied Visual Design 2018-09-21 freeCodeCamp's Adjust the Color of Various Elements to Complementary Colors, Applied Visual Design 2018-09-20 freeCodeCamp's Learn about Tertiary Colors, Applied Visual Design 2018-09-19 freeCodeCamp's Learn about Complementary Colors, Applied Visual Design 2018-09-18 freeCodeCamp's Center an Element Horizontally Using the margin Property, Applied Visual Design 2018-09-16 freeCodeCamp's Change the Position of Overlapping Elements with the z-index Property 2018-09-15 freeCodeCamp's Lock an Element to the Browser Window with Fixed Positioning, Applied Visual Design 2018-09-15 freeCodeCamp's Push Elements Left or Right with the float Property, Applied Visual Design 2018-09-15 freeCodeCamp's Lock an Element to its Parent with Absolute Positioning, Applied Visual Design 2018-09-14 freeCodeCamp's Move a Relatively Positioned Element with CSS Offsets, Applied Visual Design 2018-09-12 freeCodeCamp's Change an Element's Relative Position, Applied Visual Design 2018-09-11 freeCodeCamp's Adjust the Hover State of an Anchor Tag, Applied Visual Design 2018-09-10 freeCodeCamp's Set the line-height of Paragraphs, Applied Visual Design 2018-09-09 freeCodeCamp's Set the font-size of paragraph Text, Applied Visual Design 2018-09-09 freeCodeCamp's Set the font-weight for Multiple Heading Elements, Applied Visual Design
Tags: center an element
margin auto
using margin
applied visual design
display black
margin attribute