There is a main content div. It has a div with a picture (play button). A diva with a picture I ask padding-top 40%, and he is almost at the very bottom of the block. What is the error and how to count?

  • 40% of what size? well worth the markup and add other styles - Grundy
  • <div class = "watch-story-content"> <div class = "watch-story-button"> <img src = "img / watch-story-button.png"> </ div> </ div> - PolonskiyP
  • .watch-story {height: 550px; width: 100%; background-image: linear-gradient (to right, rgba (9, 5, 47, .85) 0%, rgba (49, 29, 94, .85) 100%), url (../img / watch-story -bg.png); } .watch-story-content {width: 960px; height: 100%; margin: 0 auto; } .watch-story-button img {width: 100px; height: 100px; } .watch-story-button {padding-top: 40%; } - PolonskiyP
  • Well, as I assumed that from the parent div. But it seems that something else is considered ... - PolonskiyP
  • all necessary markup and styles should be directly in the question, not comments - Grundy

1 answer 1

I set the padding-top 40%

In accordance with the specification, padding and margin are margin from the width, not from the height.
T. o. you set the padding to the top 40% of the page width.

  • Understood thanks! - PolonskiyP