HTML & CSS · Middle · Question 48 of 75

How do you build a two-column layout with a fixed-width sidebar and content filling the rest?

Explanation

250px 1fr - the first column is fixed, the second takes all the remaining space. 100% in the second column would overflow the container by 250px. The Flexbox equivalent: flex: 0 0 250px for the sidebar, flex: 1 for the content (and possibly min-width: 0).

Further reading

Problem with a question

HTML & CSS · Middle · question 48

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz