From the course: Interactive Animations with CSS and JavaScript

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Center element with CSS margins

Center element with CSS margins

From the course: Interactive Animations with CSS and JavaScript

Start my 1-month free trial

Center element with CSS margins

- [Instructor] So let's refer back to our wireframe and see what the next logical change to our presentation would be, and it looks like the next thing we should be doing is formatting our slide so that it's a distinct element within the presentation area. So, I'm gonna go back and look, if you see the mock-up the slide is this area, this rounded rectangle or rounded square that's within the presentation area. So I'm gonna go back to the source code, and let's go ahead and differentiate that from the background. So I'm gonna create a new hp-slide style, and we're gonna do display: block business again, and let's give it a distinct color, so background-color, so let's make it green. So I'm gonna save that off and go back to the browser. Refresh. Now you can see it is currently just a strip at the top of the presentation area. What I want to do is, let me go back to the mock-up, I want to have it off-set as an off-set, or an in-set square within the presentation area. So, to do that I'm…

Contents