Isn't setting a width pointless if you have the same value min-width & max-width?

Why is setting width to 100vw necessary when it doesn’t affect the table?

tbody td {
width: 100vw;
min-width: 4rem;
max-width: 4rem;
border: 1px solid black; //visual aid
}

nvm

  • it does matter if width property is added
  • value of width in vw doesn’t matter except when negative
  • using 100% instead of 100vw makes the table uneven
1 Like

Hi there, very nice observation!

I’ve also found out that you can delete “width: 100vw;” and add instead the more logical (for me):
tbody th {
width: 70%;
}

Well, now test what happens when you also delete:
min-width: 4rem;
max-width: 4rem;

P.S. in the same course I have seen “clip” and “clip-path” used together. I found out that “clip” is obsolete and only the mighty “clip-path” is needed.
Also, for the same effect I have used this:
span[class~=“sr-only”] {
clip-path: inset(50%);
position: absolute;
}

instead of all this bunch of code presented in the course:
span[class~=“sr-only”] {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
-webkit-clip-path: inset(50%);
height: 1px;
width: 1px;
position: absolute;
overflow: hidden;
white-space: nowrap;
padding: 0;
margin: -1px;
}

1 Like

I’ve noticed >60% of the CSS styling trickery is actually totally useless repitition (in minor cases this seems to be the case but isn’t - due to compatibility issues what seems like junk has to be written), included in the courses to help us get a better understanding of properties.

Though with good intentions, this actually isn’t too helpful. It’s bad practice, and doesn’t really fulfill the aim of aiding with understanding/exposure, receiving actual uses or even nuanced rare case usages is better than spaghetti code, or in this case, almost completely illogical code.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.