You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I used the grid setting
.menu {
grid-column: 1 / 3; <-------------
And the content
.contento {
grid-column: 3 / -1; <-------------
And resizing it's overflowed
But, this is the only configuration that works using number 2.
If you change the number it does not fit and always overflow to other box when you resize.
.menu {
grid-column: 1 / 2; <-------------
And the content
.contento {
grid-column: 2 / -1; <-------------
The text was updated successfully, but these errors were encountered:
That's expected behaviour if elements span multiple tracks.
The word "Portfólio" defines the minimum content width of its element, not the spanning grid columns, which are all set to have the same flexible width of 1fr.
To prevent spanning items like the menu from overlaping with their grid siblings you need to set their column width to "auto", "min-content" (or "max-content"). That's when they honor the (minimum) content width of the spanned items placed inside.
/* either of this works in your specific setup */
.container { grid-template-columns: auto auto repeat(10,1fr); }
.container { grid-template-columns: min-content min-content repeat(10,1fr); }
.container { grid-template-columns: max-content max-content repeat(10,1fr); }
Because "Portfólio" is a single (unbreakable) word, both "min-content" and "max-content" give the same results here. If it were "Meu Portfólio" and you add hyphenation the results differ and "Contato" might define the width.
https://codepen.io/rdsilvalopes/pen/eXQjQZ
When I used the grid setting
.menu {
grid-column: 1 / 3; <-------------
And the content
.contento {
grid-column: 3 / -1; <-------------
And resizing it's overflowed
But, this is the only configuration that works using number 2.
If you change the number it does not fit and always overflow to other box when you resize.
.menu {
grid-column: 1 / 2; <-------------
And the content
.contento {
grid-column: 2 / -1; <-------------
The text was updated successfully, but these errors were encountered: