The margin property has multiple uses. In this video, look at how margin can be used to style elements in your page layouts.
- [Instructor] The margin property can also be used…for more than just adding space.…By default, elements stack on top of each other based…on the order that the HTML is written in.…You can use negative values to move the content…outside of its stacking position.…In this example if I used a negative value…for my top and my left values, it'll actually just push…the box outside of its normal stacking order.…However, you do want to use this technique sparingly.…
This is best used to nudge elements…just outside of its position.…If you find yourself using large values to move an element…to a different position, it's probably better just…to reorder the HTML instead.…It's best practice to keep the page…in its natural flow as much as possible.…Margin can also be used…to center-align block-level elements on the page.…Use this technique to ensure the content blocks stay…center-aligned no matter the size of the browser window.…
First, a width needs to be set.…Then, set the left and right values to auto.…This auto value will make it automatically find…
- Creating a CSS file
- Writing basic selectors
- Setting properties
- Using different typefaces and web-safe fonts
- Understanding cascading and inheritance
- Setting a font family, font size, text color, and more
- Understanding the box model
- Using the float property
Skill Level Beginner
1. Getting Started
2. CSS Core
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.