CSS Only Tooltips Chris Bongers on August 07, 2020 Today we will be building some tooltips with nothing more than CSS. The idea is we hide the tooltip, and we will show it once hovering over the div... Read full post Submit Preview Dismiss Collapse Expand Nathan Kallman Nathan Kallman Nathan Kallman Follow Husband; Father; Software Engineer; Gamer; Tinkerer; Writing about code on DEV. Location Columbus, OH Education B.S. Computer Engineering Work Engineering Manager at Root Insurance Joined Oct 20, 2019 • Aug 7 '20 Dropdown menu Copy link Hide This can be done without the fixed width and without the extra markup and classes: Building a tooltip with only CSS Nathan Kallman ・ Jun 3 ・ 7 min read #css #tutorial #nojs Collapse Expand Andrew Bone Andrew Bone Andrew Bone Follow A British web developer, that is passionate about web accessibility. Location Britain, Europe Pronouns He/Him Work Senior Web Developer at Bloc Digital Joined Jun 8, 2017 • Aug 7 '20 Dropdown menu Copy link Hide Yeah pseudo classes really are king Native HTML: tooltips Andrew Bone ・ Apr 14 ・ 2 min read #html #css #tooltips #whatwg Collapse Expand Chris Bongers Chris Bongers Chris Bongers Follow Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊 Location Cape Town, South Africa Work Solution Architect at Daily Dev Tips Joined Apr 20, 2020 • Aug 8 '20 Dropdown menu Copy link Hide Very nice, I love how many ways there are to solve one problem. Definitely going to give the attributes a try Collapse Expand Chris Bongers Chris Bongers Chris Bongers Follow Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊 Location Cape Town, South Africa Work Solution Architect at Daily Dev Tips Joined Apr 20, 2020 • Aug 7 '20 Dropdown menu Copy link Hide Hey, That's a very neat solution man! How is the browser support on those selectors? I do guess my solution could be converted to use the dynamic width, but I like your approach! Collapse Expand Nathan Kallman Nathan Kallman Nathan Kallman Follow Husband; Father; Software Engineer; Gamer; Tinkerer; Writing about code on DEV. Location Columbus, OH Education B.S. Computer Engineering Work Engineering Manager at Root Insurance Joined Oct 20, 2019 • Aug 7 '20 Dropdown menu Copy link Hide I haven't tested extensively... but caniuse gives pretty wide support: caniuse.com/#feat=css-gencontent caniuse.com/#search=attribute%20se... caniuse.com/#feat=calc The most problematic one looking to be calc in IE may or may not work correctly Chris Bongers Chris Bongers Chris Bongers Follow Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊 Location Cape Town, South Africa Work Solution Architect at Daily Dev Tips Joined Apr 20, 2020 • Aug 8 '20 Dropdown menu Copy link Hide Nice, I'm going to give them a try Collapse Expand Chris Bongers Chris Bongers Chris Bongers Follow Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊 Location Cape Town, South Africa Work Solution Architect at Daily Dev Tips Joined Apr 20, 2020 • Aug 7 '20 Dropdown menu Copy link Hide It is embedded above, but dev.to doesn't seem to render the codepens. So someone asked me if i could at-least add images so they could see how it looks. Collapse Expand Andrew Bone Andrew Bone Andrew Bone Follow A British web developer, that is passionate about web accessibility. Location Britain, Europe Pronouns He/Him Work Senior Web Developer at Bloc Digital Joined Jun 8, 2017 • Aug 7 '20 • Edited on Aug 7 • Edited Dropdown menu Copy link Hide You can input a line like this in you markdown {% codepen https://codepen.io/rebelchris/pen/LYNEYEv %} and it will render like this in your post There's plenty of good stuff in the editor guide Chris Bongers Chris Bongers Chris Bongers Follow Looking to get into development? As a full-stack developer I guide you on this journey and give you bite sized tips every single day 👊 Location Cape Town, South Africa Work Solution Architect at Daily Dev Tips Joined Apr 20, 2020 • Aug 8 '20 Dropdown menu Copy link Hide Awesome man, It seems to work different on all platforms haha, probably should have read the editor guide yes 🤯 Code of Conduct • Report abuse
This can be done without the fixed width and without the extra markup and classes:
Building a tooltip with only CSS
Nathan Kallman ・ Jun 3 ・ 7 min read
Yeah pseudo classes really are king
Native HTML: tooltips
Andrew Bone ・ Apr 14 ・ 2 min read
Very nice, I love how many ways there are to solve one problem.
Definitely going to give the attributes a try
Hey, That's a very neat solution man!
How is the browser support on those selectors?
I do guess my solution could be converted to use the dynamic width, but I like your approach!
I haven't tested extensively... but caniuse gives pretty wide support:
caniuse.com/#feat=css-gencontent
caniuse.com/#search=attribute%20se...
caniuse.com/#feat=calc
The most problematic one looking to be
calcin IE may or may not work correctlyNice, I'm going to give them a try
It is embedded above, but dev.to doesn't seem to render the codepens. So someone asked me if i could at-least add images so they could see how it looks.
You can input a line like this in you markdown
and it will render like this in your post
There's plenty of good stuff in the editor guide
Awesome man, It seems to work different on all platforms haha, probably should have read the editor guide yes 🤯