<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>css on Curtis Timson</title><link>https://hugo.curtiscode.dev/tags/css/</link><description>Recent content in css on Curtis Timson</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><lastBuildDate>Wed, 16 Aug 2017 19:00:00 +0000</lastBuildDate><atom:link href="https://hugo.curtiscode.dev/tags/css/index.xml" rel="self" type="application/rss+xml"/><item><title>Styling readonly attributes with CSS</title><link>https://hugo.curtiscode.dev/post/css/style-readonly-attribute-css/</link><pubDate>Wed, 16 Aug 2017 19:00:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/css/style-readonly-attribute-css/</guid><description>There may be times in which you need to style inputs which have been set with a readonly state.
In which case you can simply include the readonly attribute in your CSS selector to target this particular state:
input[readonly] { background-color:#ccc; }</description></item><item><title>8 Tips to increase front end website performance</title><link>https://hugo.curtiscode.dev/post/front-end-dev/8-tips-to-increase-front-end-website-performance/</link><pubDate>Wed, 09 Sep 2015 00:00:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/front-end-dev/8-tips-to-increase-front-end-website-performance/</guid><description>Recently I&amp;rsquo;ve been working on front-end performance improvements for a large web application and would like to share with you my findings. The following, in no particular order, are simple tips for achieving greater website performance:
Content Delivery Networks(CDN) can be used to serve data to your clients. Not only do they provide caching abilities, reducing load on your web servers, they also usually have servers distributed across the globe in order to send responses from nearer servers to your clients.</description></item><item><title>Managing @font-face definitions with LESS</title><link>https://hugo.curtiscode.dev/post/css/managing-font-face-definitions-with-less/</link><pubDate>Wed, 04 Feb 2015 22:00:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/css/managing-font-face-definitions-with-less/</guid><description>A typical @font-face definition looks something like this:
@font-face { font-family: &amp;#39;CustomWebFont&amp;#39;; src: url(&amp;#39;customwebfont.eot&amp;#39;); src: url(&amp;#39;customwebfont.eot?#iefix&amp;#39;) format(&amp;#39;embedded-opentype&amp;#39;), url(&amp;#39;customwebfont.woff2&amp;#39;) format(&amp;#39;woff2&amp;#39;), url(&amp;#39;customwebfont.woff&amp;#39;) format(&amp;#39;woff&amp;#39;), url(&amp;#39;customwebfont.ttf&amp;#39;) format(&amp;#39;truetype&amp;#39;), url(&amp;#39;customwebfont.svg#svgFontName&amp;#39;) format(&amp;#39;svg&amp;#39;); font-weight:normal; font-style:normal; } Here we are defining the font&amp;rsquo;s name, weight, style, and providing various file types for cross-browser compatibility.
If a web application is using different web fonts, or even a different weight/style (bold/italic) for the same web font, then this code has to be practically repeated several times.</description></item><item><title>Using @font-face and preventing faux-styles</title><link>https://hugo.curtiscode.dev/post/less/using-font-face-and-preventing-faux-styles/</link><pubDate>Wed, 04 Feb 2015 00:00:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/less/using-font-face-and-preventing-faux-styles/</guid><description>@font-face is used in CSS to define a custom font style for a web page.
Some custom fonts come with multiple type-faces for different weights and italic styles.
These are often defined with seperate font-family names for each type-face.
For example the &amp;ldquo;Alegreya&amp;rdquo; font could be defined as:
@font-face{ font-family:&amp;#39;alegreya&amp;#39;; src: url(&amp;#39;Fonts/Alegreya-Regular.otf&amp;#39;); font-weight: normal; font-style: normal; } @font-face{ font-family:&amp;#39;alegreya-bold&amp;#39;; src: url(&amp;#39;Fonts/Alegreya-Bold.otf&amp;#39;); font-weight: normal; font-style: normal; } @font-face{ font-family:&amp;#39;alegreya-italic&amp;#39;; src: url(&amp;#39;Fonts/Alegreya-Italic.</description></item><item><title>Creating a new rule for a CSS class in jQuery</title><link>https://hugo.curtiscode.dev/post/jquery/creating-a-new-rule-for-a-css-class-in-jquery/</link><pubDate>Sun, 07 Oct 2012 00:00:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/jquery/creating-a-new-rule-for-a-css-class-in-jquery/</guid><description>In jQuery, to add a new style to all elements which have a particular CSS class, we can simply call a function like the following:
&amp;lt;div class=&amp;#34;foobar&amp;#34;&amp;gt;Lorem Ipsum&amp;lt;/div&amp;gt; &amp;lt;div class=&amp;#34;foobar&amp;#34;&amp;gt;Dolor sit amet&amp;lt;/div&amp;gt; function SetFooBarRed(){ $(&amp;#34;.foobar&amp;#34;).css(&amp;#34;background-color&amp;#34;, &amp;#34;red&amp;#34;); } This will add the style background-color:red to all elements with the class foobar.
&amp;lt;div class=&amp;#34;foobar&amp;#34; style=&amp;#34;background-color:red;&amp;#34;&amp;gt;Lorem Ipsum&amp;lt;/div&amp;gt; &amp;lt;div class=&amp;#34;foobar&amp;#34; style=&amp;#34;background-color:red;&amp;#34;&amp;gt;Dolor sit amet&amp;lt;/div&amp;gt; However, if we have elements which are loaded into the DOM after the initial page load, then these new elements will not have the new style automatically added to them (as they were not included within the DOM when SetFooBarRed() was called).</description></item></channel></rss>