Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Question 1.) Why does vertical centering not work if I remove the height: 100% css property?</p> </blockquote> <p>By default, the <code>html</code> and <code>body</code> elements expand height to fit their content. So, without setting the height, your <code>html</code> is only as tall as it needs to be to contain the content as styled. In addition absolutely positioned elements do not affect the size of their parents. Without setting the height to 100%, <code>area</code> will not be the full height of your window either, so you will be vertically centering in a small strip at the top of your page.</p> <blockquote> <p>Question 2.) When height: 100% is declared on the html tag, why is the site bigger than 100% and extends beyond the browser window?</p> </blockquote> <p>That alone will not extend beyond the page boundaries. However, if you add margins, borders, or similar attributes to 100% elements, these are added <em>in addition</em> to the 100%, making your elements extend past the edge of the window.</p> <blockquote> <p>Question 3.) Why is bottom-left displayed correctly, but not bottom-right?</p> </blockquote> <p>You are absolutely positioning these elements. Div elements are generally 100% the width of the parent element. However, when you absolutely position them, their width shrinks to fit the content. In your case, you are trying to <code>text-align</code> within a <code>div</code> that is left-aligned by default. Because the <code>div</code> is only as big as the text, left, right, and center alignment all look the same. Because you are already absolutely positioning the <code>div</code>s, just use absolute positioning to align them:</p> <pre><code>.bottom-left { position: absolute; bottom: 15px; left: 15px; } .bottom-right { position: absolute; bottom: 15px; right: 15px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload