freeCodeCamp's Center an Element Horizontally Using the margin Property, Applied Visual Design

Channel:
Subscribers:
8,020
Published on ● Video Link: https://www.youtube.com/watch?v=ije7Y-izk6U



Duration: 2:02
30 views
0


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-27freeCodeCamp's Use the CSS Transform scale Property to Scale an Element on Hover
2018-09-27freeCodeCamp's Use the CSS Transform scale Property to Change the Size of an Element
2018-09-26freeCodeCamp's Create Texture by Adding a Subtle Pattern as a Background Image, url function
2018-09-25freeCodeCamp's Use a CSS Linear Gradient to Create a Striped Element
2018-09-24freeCodeCamp's Create a Gradual CSS Linear Gradient, Applied Visual Design
2018-09-22freeCodeCamp's Adjust the Tone of a Color, Applied Visual Design
2018-09-22freeCodeCamp's Adjust the Hue of a Color, Applied Visual Design
2018-09-21freeCodeCamp's Adjust the Color of Various Elements to Complementary Colors, Applied Visual Design
2018-09-20freeCodeCamp's Learn about Tertiary Colors, Applied Visual Design
2018-09-19freeCodeCamp's Learn about Complementary Colors, Applied Visual Design
2018-09-18freeCodeCamp's Center an Element Horizontally Using the margin Property, Applied Visual Design
2018-09-16freeCodeCamp's Change the Position of Overlapping Elements with the z-index Property
2018-09-15freeCodeCamp's Lock an Element to the Browser Window with Fixed Positioning, Applied Visual Design
2018-09-15freeCodeCamp's Push Elements Left or Right with the float Property, Applied Visual Design
2018-09-15freeCodeCamp's Lock an Element to its Parent with Absolute Positioning, Applied Visual Design
2018-09-14freeCodeCamp's Move a Relatively Positioned Element with CSS Offsets, Applied Visual Design
2018-09-12freeCodeCamp's Change an Element's Relative Position, Applied Visual Design
2018-09-11freeCodeCamp's Adjust the Hover State of an Anchor Tag, Applied Visual Design
2018-09-10freeCodeCamp's Set the line-height of Paragraphs, Applied Visual Design
2018-09-09freeCodeCamp's Set the font-size of paragraph Text, Applied Visual Design
2018-09-09freeCodeCamp'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