Category Archives: CSS3

Enabling Placeholders in ContentEditable Elements with CSS

Recently I worked on an HTML5 app, utilizing contenteditable elements. According to the specs of the app, the empty editable elements were supposed to have placeholder texts and since the placeholder attribute is only supported by standard input boxes and textareas I was planning to use JavaScript to enable this functionality in contenteditable elements, but then I decided to try this small CSS trick with generated content and the attr(attribute) function, which actually worked:

The CSS:

    content: attr(data-placeholder);
    font-style: italic;
    opacity: .75;

… And the Markup:

<div contenteditable data-placeholder="Add some text..."></div>

If you are interested in more CSS3, HTML5 WebComponents and JavaScript stuff, make sure you check my experiments website.

Adding Icons to the Option Elements of the Select Tag in Firefox. Quick and Dirty

Below is a quick and dirty solution for adding icons to the <option /> elements of the <select /> tag utilizing CSS generated content.

Disclaimer: According to the CSS specs, the <option /> element should not support generated content, and this solution works only in Firefox. Anyways, it may come handy sometime.

The Result:


The CSS:

.acidjs-cssw-select-icons option::before
    content: "";
    display: inline-block;
    vertical-align: middle;
    margin: 2px 6px 2px 2px;
    width: 16px;
    height: 16px;
    background: url("path/to/the/icon.png") no-repeat center;

The demo and the download link are on this page. If you are interested in more CSS3, HTML5 WebComponents and JavaScript stuff, make sure you check my experiments website.

Collaboration with Webucator

A couple of weeks ago I was contacted by Webucator asking me if I’d be interested in the creation of a video tutorial with my Parallax Page Scroll Effect with Pure CSS3. No JavaScript. No Hassle blog post and experiment. Of course, I was much excited by the idea, especially when I was told that it will be directed and narrated by Chris Minnick from WatzThis – a published author of several amazing books on web development.

The video is available on YouTube already. Enjoy, have a great weekend and make sure you pay a visit to my new friends at Webucator if you are looking for professional online and onsite instructor-led training classes in web- and software development.

5 Years of Ribbon JS!

Ribbon JS is turning 5 this month! If you are planning to purchase a license, now it’s the time. Join the celebration and get any commercial license for the most advanced and feature-complete JavaScript, HTML5 and CSS3 MSOffice-like ribbon control available on the Internet today at a half price only in August 2015!

Fair and Simpler Ribbon JS Licenses

With the release of version 4.3.0 of Ribbon JS, the commercial version of the control is now offered in two fair types of licenses – discounted and full commercial. The non-source code option has been removed and now source code is included in all licenses. Here are the details for the new purchase options:

Discounted License with Source Code

  • You are an individual, using Ribbon JS only for personal projects.
  • You are an individual or business, using Ribbon JS for commercial projects, and your yearly gross revenue does not exceed $10,000 USD.
  • You are an educational or non-profit organization.
  • 25% discount on major updates.

Full Commercial License with Source Code

  • You should purchase this license if none of the conditions of the Discounted License with Source Code applies.
  • 10% discount on major updates.

About Ribbon JS:

Ribbon JS is arguably the best recreation of the MS Officetm ribbon bar, using JavaScript, CSS3, and HTML5. It is a lightweight control, which is ready to use on websites, web-based WYSIWYG editors, sophisticated back-end systems, mail applications, complex file managers, and JavaScript-heavy apps. It has everything you would expect from a ribbon bar – comprehensive and fully documented API, amazing command handling, huge set of inbuilt tools, capability to add custom tools via client-side templates, cool looks, support for AngularJS directives and is also available optionally wrapped as a full-blown HTML5 WebComponent. Last but not least, it only takes a few minutes to deploy, configure, and run.