There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
overflow: scroll; creates two scroll bars in my browser, even if only (for example) the vertical one is needed. It’s not ideal aesthetically. How do I create only a vertical scroll bar?
In the text for this exercise, in number 9 it gives possible values for the overflow property of display, hide and scroll. Shouldn’t this be visible, hidden and scroll?
Under .share, padding is set to 0px at the sides but the borders of my light grey box go all the way to the ends of the browser. From my understanding, wouldn’t 0 padding at the sides lead to the grey box ending right where the red buttons are?
Again under .share, does position: relative serve to create a “base” for the buttons in .share a? So the margin of 10px is for the buttons in relation to the grey box?
Not a response, but a question… Where is the width and height inherited from?
The best element to have that property assigned is the parent. All you’re trying to do is break out of the inherited default static property of the body. The children will be relative to the parent, not the document.body.
In this exercise, we can see that there is some space between the <div> with a class of share and the <body>. However, I assumed it was simply margin, but when I checked, the <div> had no margin. What is that space then?
Note: I changed the background color of the <body> to make it clearer where the space is
This exercise says " * The overflow property can be set to display , hide , or scroll , and dictates how HTML will render content that overflows its parent’s content area."
however, the overflow have property as hidden, visble and scroll. or it can be visble. hide and scroll?
How do I adjust vertical position of elements inside the box model?
After I’ve tried changing the height of share elements at the bottom of page the text inside has become misaligned relatively to the background. I was able to fix it’s position manually by using line-height property. Tried setting a vertical-align: middle; declaration to .share a but it doesn’t work for some reason. Surely there’s a way to make text stay in the middle regardless of other properties.
That would be okay since modern browsers scale everything, unlike in the old days when px was fixed and did not scale. In light of scaling, it is arbitrary to use px. My old school thinking still prefers proportional relationship over fixed (purportedly) size.
The key is to get vertical centering without using padding since it has an effect on the box size. Line-height is preserved when wrapping, so be careful how much text you apply it to and be sure it scales correctly for all practical purposes.
When we wish to make things proportional in all device widths, would be one. Pixels widths do not change when the browser window is widened or narrowed. Percentages allow regions to grow and shrink in proportion to one another. It makes the page more adaptable.