5 Weird CSS properties you didn’t know about

4 min read
Watb Team
Code on a screen

The CSS specification is huge, but as a front-end developer or designer, you probably only know a fraction of what’s there. This means that there’s a lot in the specification you’ll have never come across before. But because of it’s size, I’ve trawled it for you and picked out 5 weird CSS properties I’d love you to find out about. Some you can use now, some you can’t use at all, but hopefully this will open your eyes to the size and breadth of the spec and encourage you to explore more properties.

CSS @supports

For years we’ve trusted Javascript and feature detection libraries such as Modernizr so we can elegantly degrade or enhance our web projects for different browsers. But this often leads to ugly flashes of content and isn’t entirely reliable. Thankfully, the CSS spec contains a property called @support that allows us to feature detect with CSS. This brings about many benefits, such as reduced dependency on JS, whilst feeling a lot less hacky and leading to easier to maintain code.

Example:

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008000; font-weight: bold">@supports</span> <span style="color: #666666">(</span> <span style="color: #008000; font-weight: bold">display</span><span style="color: #666666">:</span> <span style="color: #008000; font-weight: bold">flexbox</span> <span style="color: #666666">)</span> { <span style="color: #008000; font-weight: bold">rules</span> <span style="color: #008000; font-weight: bold">here</span> }
</pre></div>

We may be using flexbox, but still wish to support older browsers. This particular rule allows us to wrap our flexbox CSS within a @supports conditional, so only browsers that support flexbox bother applying the rules.

Supported Browsers

More Examples

CSS Resize

Commonly, we use JS libraries such as jQuery UI to allow users to dynamically interact with elements including moving them and resizing them. However, the CSS property resize allows us to achieve the same end result, when assigned to an element, the user will be able to drag the corners of the element to resize it.

Example:

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #0000FF; font-weight: bold">.module</span> { resize<span style="color: #666666">:</span> <span style="color: #008000; font-weight: bold">both</span>; }
</pre></div>

This particular rule allows the element .module to be resized both width ways and height ways.

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #0000FF; font-weight: bold">.module</span> { resize<span style="color: #666666">:</span> horizontal; }
</pre></div>

Supported Browsers

More Examples

CSS Hanging Punctuation

If you were reading the previous two, then I really hope this one will be new to you! It certainly was a property I had never come across before. That said, it should be a term familiar to anyone who works with type. Effectively, it allows us to move the position of punctuation marks to either within the margins of the text element or to the outside. Previously this was achieved using text-indent hacks but now there is a specific property. Sadly however, no browsers have yet adopted the property.

Example:

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #0000FF; font-weight: bold">.text</span> { hanging<span style="color: #666666">-</span>punctuation<span style="color: #666666">:</span>force<span style="color: #666666">-</span>end; }
</pre></div>

This rule makes the stop or comma at the end hang.

Supported Browsers – None. Boo, hiss, boo.

More info

CSS currentcolor

A property that allows you to assign your color property value to other properties that also accept a color value.

Example:

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008000; font-weight: bold">div</span> { <span style="color: #008000; font-weight: bold">color</span><span style="color: #666666">:</span> <span style="color: #008000">red</span>; <span style="color: #008000; font-weight: bold">border</span><span style="color: #666666">:</span> <span style="color: #666666">5px</span> <span style="color: #008000; font-weight: bold">solid</span> currentColor; }
</pre></div>

The border will be red. This is almost a sort of halfway house to using CSS variables. In all likelihood, if you’re already writing Sass you’ll have little use for this property but it can certainly be useful for those who write vanilla CSS still. Browser support is excellent too.

Supported Browsers

CSS @scope

We have scope in other languages, but until now scope has never existed in CSS. This all changes with the @scope rule. With Sass for example, all variables we declare effectively exist within a global scope. We can’t re-define a variable within a media query or an element.

We could use nesting to achieve a vaguely similar end result, but nesting increases specificity. I still personally nest (99% of the time only 1 level deep) but many developers are calling on the industry to drop it altogether. This seems particularly an issue on larger scale projects.

CSS @scope allows us to finally use scoping but without nesting.

Example:

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008000; font-weight: bold">@scope</span> <span style="color: #008000; font-weight: bold">div</span> {
 <span style="color: #008000; font-weight: bold">span</span> {
   <span style="color: #008000; font-weight: bold">color</span><span style="color: #666666">:</span> <span style="color: #008000">blue</span>;
 }
}
<span style="color: #008000; font-weight: bold">@scope</span> <span style="color: #008000; font-weight: bold">section</span> {
 <span style="color: #008000; font-weight: bold">span</span> {
   <span style="color: #008000; font-weight: bold">color</span><span style="color: #666666">:</span> <span style="color: #008000">orange</span>;
 }
}
</pre></div>

In the following code:

<div style="background: #f8f8f8; overflow:auto;width:auto;padding:.8em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #008000; font-weight: bold">&lt;div&gt;</span>
 <span style="color: #008000; font-weight: bold">&lt;section&gt;</span>
   <span style="color: #008000; font-weight: bold">&lt;div&gt;</span>
     <span style="color: #008000; font-weight: bold">&lt;span&gt;</span>text<span style="color: #008000; font-weight: bold">&lt;/span&gt;</span>
   <span style="color: #008000; font-weight: bold">&lt;/div&gt;</span>
 <span style="color: #008000; font-weight: bold">&lt;/section&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/div&gt;</span>
</pre></div>

The text will be blue.

Sadly, browser support for @scope is non-existent, so we can’t use it yet.

More Info

Wrap Up

Ok – so much of the above is probably quite useless but that wasn’t really the point. I wanted to highlight the scale of the CSS spec, and encourage you as a developer to expand your knowledge of CSS. Some of these new properties may not be in use yet, but knowing about them in advance could also give you an advantage.

Good luck!

The CSS specification is huge, but as a front-end developer or designer, you probably only know a fraction of what’s there.

Social Media Management Software

In order to promote your business and reach consumers that spend an entire 24 hours a week online, you need to make sure that you have a viable social media strategy in place.

By posting unique and interesting content on your social media platforms, and by actively engaging with followers, you can start to turn this into a funnel for generating leads.

In order to stay on top of your social media strategy, it’s important to have some form of social media management software to do some of the heavy lifting. Software such as this is imperative for scheduling, tracking and monitoring social media content.

At its best, social media management software can help you not only plan your content months in advance, but also remain reactive by letting you tune into ongoing news stories or trending topics.

Screenshot of Hootsuite's homepage

We recommend: Hootsuite

There are a whole bunch of social media management companies out there and all of them offer roughly the same sort of package but Hootsuite is the only one that offers an actually free service (as opposed to just a free trial period).

They do try to hide it on their website though so make sure you follow this link in order to get to the right page.

The free version of this software lets you:

  • Manage up to three social media profiles from a choice of channels including Facebook, Twitter, Instagram, Pinterest and LinkedIn
  • Schedule up to 30 posts in advance at any point in time
  • Track follower growth, likes and comments
  • Integrate two RSS feeds in order to find and share compelling content
  • Access Hootsuite’s online help center and community forum

Of course, there’s also a number of paid-for packages that you can buy from Hootsuite that give you access to a great number of services including higher ad spend budgets, automated post scheduling and custom analytics.

But if you’re a small business looking to get started, the free version of the software should be comprehensive enough to allow you to get your social media strategy in motion.

Website Tracking Software

We’ve said before that the secret to a successful lead generation strategy is to keep analysing and refining your methods. Well, website tracking software is the best way to conduct this analysis.

By digging into the analytics of your visitors’ actions, you can start to gain a better picture of why people come to your site, what they want from it, what they dislike about it and how you can improve upon their experience next time.

There are a wide variety of services that can fall into the category of website tracking software, including heatmaps, funnels, user polls, surveys, visitor recordings and more.

Basically, any kind of software that collects data about the ways in which your visitors interact with your site can be considered website tracking software.

Screenshot of Hotjar's homepage

We recommend: Hotjar

Whereas there are a multitude of smaller software companies that focus in on just one website tracking service, Hotjar offers an array of useful tools.

Hotjar tools include:

  • Click, move, scroll, download and share heatmaps that can also be split by device type
  • Visitor recordings that allow you to replay sessions of real site visitors
  • Conversion funnels that identify on which page and at which step the most visitors are leaving your site
  • Form analysis that can help you to discover which fields take too long to fill, which are left blank and why your visitors abandon your form and page
  • A customizable widget that allows you to create pop-up feedback polls
  • Responsive surveys that can be distributed through web links and emails, or featured your site just before your visitors abandon the page in order to discover what their concerns are
  • The ability to recruit test users in order to get instant feedback on your site

Hotjar’s free service is able to collect data from 2000 page views a day and will give you access to up to 300 visitor recordings and 3 heatmaps, forms, funnels, polls and surveys. Unlimited users can be added to your account and Hotjar will also store your data for a full year.

While we’d normally recommend free services when possible, it’s probably worth paying for Hotjar’s Plus plan to begin with.

For just under £25 a month you can collect data from 10,000 page views a day and have unlimited services and reports. Plus there’s even a 15-day free trial for you to test out whether you like their software or not.

Remember

Lead generation doesn’t have to be an expensive endeavour.

What’s important is that you put real effort into all of your interactions with potential leads - whether that’s through educational and informative blog posts, social media interactions or even just a chat on the phone.

If you believe in your business’ ability to help its customers then all you have to do is let that shine through.

Ultimately, these tools are just there to help you meet potential leads on their level. The rest is up to you.

Related Posts

Posts you may also like