FAQ: The Box Model - Height and Width


#1

This community-built FAQ covers the “Height and Width” exercise from the lesson “The Box Model”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn CSS

FAQs on the exercise Height and Width

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

on this task of “Height and Width” it asks you to add height: 700px; into CSS however I am confused why it changes the size of the image rather than the text inside the

tag??

#3

because the banner takes care of the entire space, including the image. if you would want to change the actual text, then you would have to go to #banner .content h1. (because h1 is the text) and change the size there


#4

That much specificity is not required. Ideally we should work with the least specificity possible so upgrades and mods are simpler. If there is only one H1 in the page, or in the case of there being more than one if you want them all the same size then,

body {
  font-size: 100%;
}
h1 {
  font-size: 1.5rem;
}

The first rule above is to accept the base font size set by the user. Then the H1 is relative to that. A default H1 is 2rem (about 32px).


#5

i get my paragraph aligned to the left when i make it width:30 px;. but when i make it 350 (which is a lot more) i get it normally as a paragraph . how come?


#6

on this task of “Height and Width” it asks you to add height: 700px; into CSS however I am confused why it changes the size of the image rather than the text ? I cleared everything in style.css and wrote new codes, and it still didnt change. please help!!!