- This topic is empty.
-
AuthorPosts
-
May 24, 2018 at 10:11 am #271637boqscParticipant
I have been playing around with CSS Grid layout system,
and suddenly come up with this CSS reset technique:/* Modern CSS style reset */ * { all: unset; } head, head > * { display: none !important; }
Did some Googling and Stackoverflow and couldn’t see anyone pointing out the problem with the head, style and title tags being displayed as blocks. I quickly fixed this by selecting head and everything inside head. Giving them display of none as was the default before any CSS reset.
So far, no more problems with this. Is there anything more that I must be aware while using this kind of technique?
making their original stateMay 24, 2018 at 10:40 am #271638Paulie_DMemberI’ve never seen this issue you mention that would require this resolution.
Can you demonstrate it? Those elements would not be affected unless the
html
element has been givendisplay:grid
and there is no reason to do that….that’s what thebody
element is for.May 24, 2018 at 11:52 am #271639tomnoble92ParticipantWhen would you ever need to style the head or title tag?
Can you give us an example?
May 24, 2018 at 1:16 pm #271648boqscParticipantSurely, this is an example where, removing the lines
head, head > * {
display: none !important;
}Will give you output of the CSS style in the top left side of the page, without anyone asking for it.
Codepen didn’t let me to put in my head tags that would contain title or style tags in the html part.
But the proof is there, try to uncomment my solution after you get annoyed of style tag being printed out.
May 24, 2018 at 1:18 pm #271649boqscParticipantAlthough, it seems that head is also visable that is of CodePen – A Pen by Feldwor.
So, here you got it folks.May 24, 2018 at 1:36 pm #271652boqscParticipantYep, I finally getting to the conclusion that trying to make use of html tag might break the html standards.
May 24, 2018 at 2:28 pm #271654tomnoble92ParticipantYou don’t want to be setting every single element’s properties to inherit.
When you use
* {
all: unset;
box-sizing: border-box;
}Your removing all the user agent styles.
For example style{display: none}
that’s why the stylesheet is printing to the page…same with the line of javascript.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.