Skip to content

Commit

Permalink
Background position (#4076)
Browse files Browse the repository at this point in the history
* background-position examples

Uploaded background-position examples to represent existing code blocks.

* Update background-position.md

Added image links to media folder to represent the example code blocks.

* Uploaded fixed background-position example

Fixed alignment on the example image.

* Update background-position.md

Added short sentence before each image.

---------

Co-authored-by: SSwiniarski <[email protected]>
  • Loading branch information
Grzesieg and SSwiniarski authored Dec 19, 2023
1 parent a941141 commit 54d46c6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Set background image position to the top right corner of `.hero` class element:
}
```

The following is the result of the code block above:

![Background image on top right of the browser](https://raw.githubusercontent.com/Codecademy/docs/main/media/background-position-example-1.png)

## Example 2

Use percentages to place background image in the middle of the element:
Expand All @@ -53,6 +57,10 @@ Use percentages to place background image in the middle of the element:
}
```

The following is the result of the code block above:

![Background image in the middle](https://raw.githubusercontent.com/Codecademy/docs/main/media/background-position-example-2.png)

## Example 3

Use pixels to place background image `100px` down the y-axis and `100px` along the x-axis:
Expand All @@ -65,6 +73,10 @@ Use pixels to place background image `100px` down the y-axis and `100px` along t
}
```

The following is the result of the code block above:

![Background image 100px down and 100px right](https://raw.githubusercontent.com/Codecademy/docs/main/media/background-position-example-3.png)

## Example 4

Position multiple images:
Expand All @@ -76,3 +88,7 @@ Position multiple images:
background-position: top left, bottom right;
}
```

The following is the result of the code block above:

![Two background images in different positions](https://raw.githubusercontent.com/Codecademy/docs/main/media/background-position-example-4.png)
Binary file added media/background-position-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/background-position-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/background-position-example-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/background-position-example-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 54d46c6

Please sign in to comment.