HTML Academy
Real-Life Triangles, Part 1
Frames and Backgrounds32/33
Back to the list of tasks
  • 1. Preparation
  • 2. Background Size, Step 1
  • 3. Background Size, Step 2
  • 4. Background Borders
  • 5. Background Cropping
  • 6. Multiple Background Images
  • 7. Positioning the background relative to different borders
  • 8. background-repeat: round
  • 9. background-repeat: space
  • 10. Outer Frame
  • 11. Rounding Corners, Part 1
  • 12. Rounding Corners, Part 2
  • 13. Frame Image: border-image-source
  • 14. Frame Image: border-image-slice
  • 15. Slicing Asymmetrical Images
  • 16. Frame Image: border-image-repeat, Part 1
  • 17. Frame Image: border-image-repeat, Part 2
  • 18. Frame Image: border-image-width
  • 19. Frame Image: border-image-outset
  • 20. Muffin’s Royal Frame
  • 21. Muffin’s Eco-Frame
  • 22. Muffin’s Round Frame, Part 1
  • 23. Muffin’s Round Frame, Part 2
  • 24. Challenge: The Sea Wolf
  • 25. Frames and Triangles, Part 1
  • 26. Frames and Triangles, Part 2
  • 27. Frames and Triangles, Part 3
  • 28. Creating an Arrow with a Frame
  • 29. Creating a Round Arrow with a Frame, Part 1
  • 30. Creating a Round Arrow with a Frame, Part 2
  • 31. Real-Life Triangles, Part 1
  • 32. Real-Life Triangles, Part 2
  • 33. Challenge: Jewelry Work
Challenge: Jewelry Work
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Real-Life Triangles, Part 2

Now let’s add the additional classes arrow-up and arrow-down, which will indicate the direction of the up and down arrows.

For the up arrow, you will need to remove the upper frame from the pseudo-element, and for the down arrow you will need to remove the lower frame. To make the arrows behave like flowing text, we assigned the block-inline type to the pseudo-elements.

And the last step is to hide the text of the label for the link. To do this, simply set the font size to zero.

There is also a more complex version of the arrows that is used for sorting: when two arrows are created for each parameter at once. This option is implemented in a similar way, but here both pseudo-elements ::before and ::after are used to create the arrows.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Real-Life Triangles, Part 2</title> <meta charset="utf-8"> <link rel="stylesheet" href="setting.css"> <link rel="stylesheet" href="style.css"> </head> <body class="geometry"> <div class="goods"> <p> Sorting: <a class="arrow arrow-up" href="#">Ascending</a> <a class="arrow arrow-down" href="#">Descending</a> </p> <ul> <li>Toy mouse</li> <li>“Sheep hunter” cat teaser</li> <li>“Wolverine” scratching post </li> <li>Fragrant dill weed for gourmet cats</li> </ul> </div> </body> </html>
CSS
a.arrow { display: inline-block; margin: 0 10px; } .arrow::before { border: 20px solid #0074d9; border-right-width: 10px; border-right-color: transparent; border-left-width: 10px; border-left-color: transparent; content: ""; } .arrow-up::before { } .arrow-down::before { }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. For .arrow-down::before, set the thickness of the lower frame to zero,
    2. and then for .arrow-up::before set the thickness of the upper frame to zero.
    3. Assign the display: inline-block property to .arrow::before,
    4. and then set the font size to zero for the .arrow links themselves.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.