mber that when creates an imp ng to this synta: e this:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
3. We gave the grid lines around the main area names, so let's use them to
place the main grid item:
main {... grid-row: main-start / main-end; grid-column: main
Do you remember that when you name lines around an area *-start
and *-end, it creates an implicitly named area *? Because we named the
lines according to this syntax, we could also place the main element with
grid-area like this:
main {... grid-area: main;}
4. Finally, we can put the footer into its place. It starts at the last row grid
line and spans back one track. For columns, it starts at the third line and
goes to the last. Here is one way to write those instructions. Can you
come up with others that achieve the same result?
footer {_grid_row: 5 / 6; grid-column: 3 / -1;}
Save your file and look at it in the browser. You may spot a problem, de-
pending on the width of your browser window. When the browser is
wide, the layout works fine, but when it is made narrower, the text in
the main element overflows its cell. That's because the 300-pixel height
we gave that row is not sufficient to hold the text when it breaks onto
additional lines or is resized larger.
5. We can fix that by changing the measurement of the fifth row track to
auto. In that way, the height of that row will always be at least big
enough to hold the content. The min-content value would work as well,
but auto is always the first value to try:
#layout { display: grid; grid-template-rows: 3em 20px [mai
}
If you reload the page in the browser, the text is always contained in its grid
area, regardless of the width of the window. Everything should fall into place
nicely, as shown in FIGURE 16-41.
You now have your first grid layout under your belt. This exercise gives you
only a taste of what Grid Layout can do, but we've covered the fundamentals
of setting up a grid and placing items in it. You're off to a great start!
Transcribed Image Text:3. We gave the grid lines around the main area names, so let's use them to place the main grid item: main {... grid-row: main-start / main-end; grid-column: main Do you remember that when you name lines around an area *-start and *-end, it creates an implicitly named area *? Because we named the lines according to this syntax, we could also place the main element with grid-area like this: main {... grid-area: main;} 4. Finally, we can put the footer into its place. It starts at the last row grid line and spans back one track. For columns, it starts at the third line and goes to the last. Here is one way to write those instructions. Can you come up with others that achieve the same result? footer {_grid_row: 5 / 6; grid-column: 3 / -1;} Save your file and look at it in the browser. You may spot a problem, de- pending on the width of your browser window. When the browser is wide, the layout works fine, but when it is made narrower, the text in the main element overflows its cell. That's because the 300-pixel height we gave that row is not sufficient to hold the text when it breaks onto additional lines or is resized larger. 5. We can fix that by changing the measurement of the fifth row track to auto. In that way, the height of that row will always be at least big enough to hold the content. The min-content value would work as well, but auto is always the first value to try: #layout { display: grid; grid-template-rows: 3em 20px [mai } If you reload the page in the browser, the text is always contained in its grid area, regardless of the width of the window. Everything should fall into place nicely, as shown in FIGURE 16-41. You now have your first grid layout under your belt. This exercise gives you only a taste of what Grid Layout can do, but we've covered the fundamentals of setting up a grid and placing items in it. You're off to a great start!
EXERCISE 16-5. Placing items on a grid
Now that we have the grid set up for the Breads of the World page, we can
place items into the correct grid areas by using line numbers and names.
I'm going to go through them quickly, but feel free to save the file and look at
the page in a grid-supporting browser at any step along the way. Refer to the
finished layout in FIGURE 18-41 for the final item positions and line number
hints.
1-
2.
main-start
main-start Introducing Breads of the World!
main-end
-end 3
FIGURE 16-41. The final Breads of the World grid layout.
1. Open grid.html in your text editor if it isn't open already. We'll start by
placing the nav element into the first row of the grid, using the four grid
line properties:
nav { grid-row-start: 1; grid-row-end: 2; grid-column-sta
2. Now place the figures in their positions on the grid. Start by putting the
third figure (#figc) in its place in the far-right column by using the
shorthand grid-row and grid-column properties. It goes between the 3rd
and 4th row grid lines and extends from the 7th to 8th column lines. For
columns, instead of 7 and 8, use the negative value for the last line and
span it one space to the left to get to the starting point:
#figc { grid-row: 3 / 4; grid-column: span 1 / -1;}
Now position the #figA and #fige elements by using the grid-area prop-
erty with line values. Remember that the values go in the order top, left,
bottom, right (counterclockwise around the area).
#figA { grid-area: 3 / 3 / 4 / 4; } #fige { grid-area: 3 / 5
Transcribed Image Text:EXERCISE 16-5. Placing items on a grid Now that we have the grid set up for the Breads of the World page, we can place items into the correct grid areas by using line numbers and names. I'm going to go through them quickly, but feel free to save the file and look at the page in a grid-supporting browser at any step along the way. Refer to the finished layout in FIGURE 18-41 for the final item positions and line number hints. 1- 2. main-start main-start Introducing Breads of the World! main-end -end 3 FIGURE 16-41. The final Breads of the World grid layout. 1. Open grid.html in your text editor if it isn't open already. We'll start by placing the nav element into the first row of the grid, using the four grid line properties: nav { grid-row-start: 1; grid-row-end: 2; grid-column-sta 2. Now place the figures in their positions on the grid. Start by putting the third figure (#figc) in its place in the far-right column by using the shorthand grid-row and grid-column properties. It goes between the 3rd and 4th row grid lines and extends from the 7th to 8th column lines. For columns, instead of 7 and 8, use the negative value for the last line and span it one space to the left to get to the starting point: #figc { grid-row: 3 / 4; grid-column: span 1 / -1;} Now position the #figA and #fige elements by using the grid-area prop- erty with line values. Remember that the values go in the order top, left, bottom, right (counterclockwise around the area). #figA { grid-area: 3 / 3 / 4 / 4; } #fige { grid-area: 3 / 5
Expert Solution
steps

Step by step

Solved in 7 steps with 7 images

Blurred answer
Knowledge Booster
Managing System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education