diff --git a/guide/english/css/layout-horizontal-and-vertical-align/index.md b/guide/english/css/layout-horizontal-and-vertical-align/index.md index 41bfb8d385a..723f8382df5 100644 --- a/guide/english/css/layout-horizontal-and-vertical-align/index.md +++ b/guide/english/css/layout-horizontal-and-vertical-align/index.md @@ -2,14 +2,152 @@ title: Layout Horizontal and Vertical Align --- ## Layout Horizontal and Vertical Align +CSS has properties that create space both around and inside an element. You will use one, or a combination of these properties to create layouts. -This is a stub. Help our community expand it. +### Properties Used To Create Layouts +You will use the following properties to align elements and create layouts: +- [margin](https://guide.freecodecamp.org/css/margins/) +- [position](https://guide.freecodecamp.org/css/css-position) +- [float and clear](https://guide.freecodecamp.org/css/layout/float-and-clear) +- [text-align](https://guide.freecodecamp.org/css/text-align) +- [padding](https://guide.freecodecamp.org/css/padding) +- [line-height](https://guide.freecodecamp.org/css/text) -This quick style guide will help ensure your pull request gets accepted. +### Horizontal Align +The `margin` property will create space around an element. Use the `auto` value to equally distribute remaining space on either side. - +```css +.horizontal-center { + margin: auto; +} +``` -#### More Information: - +`Block` elements must have a `width` set to avoid filling the viewport: +```html +
+```
+
+```css
+img {
+ display: block;
+ width: 250px;
+ margin: auto;
+}
+```
+
+Use the `position` property and set left and right location of the element.
+
+```html
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+