Find A Job Through Vettery — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.
Vettery
|
📙 Articles, Tutorials & Opinion
|
A Love Letter to My Website — Now this isn’t particularly related to development, but here Tobias shares his “declaration of love for personal websites” — and thinks we should be making more of them. I’m inclined to agree.
House of van Schneider
|
supported by
|
|
Styling links with CSS selectors
CSS selectors offer a powerful way to add style, and contextual information, to HTML elements, and while you can target element IDs, classes, etc. the spec hash been fleshed out over the years to support lots of other things you can easily select to style.
John Rhea highlights the wide variety in which they can be used in this excellent article, but for today we're just going to look at how they can be utilised for links.
Let's say you want to style links to PDF documents, signifying to the user that the link is to a 'document', rather than a Web page. This can be achieved like so:
|
a[href$=".pdf"] {
background: url('https://ift.tt/2n0g9v0)
0 50% no-repeat;
padding-left: 20px;
}
|
The $= operator in the attribute selector targets the end of the attribute value, looking specifically for links to PDFs. It will then add the linked PDF icon before the full link, like so:
This is just one quick example of how this can be used. You could also use this technique to style links to certain sites, style internal links differently to those that are outbound, or even to style certain images by targeting the src attribute of a file. It's worth playing around and experimenting!
This Tip of the Week is sponsored by Flatiron School, where you can learn software engineering, data science, or UX/UI design in just 15 weeks online or on campus.
|
|
🔧 Code, Tools & Resources
|
OGL: A Minimal WebGL Framework — WebGL is not the easiest technology to use on its own, so libraries like Three.js are often used to make its functionality more accessible. This is a lighter weight attempt to keep you close to the metal without cutting your hands.
Nathan Gordon et al.
|
Cursor? — This is a somewhat weird and trippy cursor effect, making use of SVGs.
Hazem Osama codepen
|
|
No comments:
Post a Comment