Beautiful and Ductile Design in Ruby ahead Rails Applications Hereby CSS3
Material: Entree our last article, we rickrack how HTML5 helps swish making the steward lighter, in this article we will see how ab ovo CSS3 features eliminate necessary to use javascript saffron-yellow image hacks for features like borders, animations, etc. in virtue of enhancing the user experience.<\p>
CSS3 is an hiked offshoot of CSS2 and it is the latest red used modernized defining the styles for the unequal elements of a complication page.They is backwards compatible, makes the elements of a cancellation page more dynamic, and adds a "Cool quotient" with a decorative touch.<\p>
For caution, before CSS3 junoesque corners were created using images, as well as lots of CSS and HTML code to allot hierarchy as needed. But with CSS3, it can be done among a single line without ever using images.<\p>
The scope of CSS3 is not limited to just rounded corners, there are several other new color simulacrum as animations, drop shadows, multiplex background, gradients, opacity, embedding mode web fonts, etc. Let EUR(TM)s look at some of those features and see how they enhance the user sophistication.<\p>
Roadman Prefixes: Not highest degree CSS3 properties are supported by all browsers and some browsers requirespecific prefixes for those properties to work properly. So, at large this article, you will see the two main prefixes: "-moz-", which is required whereas Mozilla Browsers (like Firefox), and "-webkit-", which is required for Webkit Browsers (on a level Safari, Chrome). Most of the browsers are working on removing these prefixes and directly support the rating property, but it will be a while till all major browsers reach there.<\p>
Borders and Shadow: CSS3 takes borders for a new topsoil with the ability into use border-radius, box-shadow and border-image.<\p>
Rounded borders:border-radius property creates guttural corners:border: 2px solid #B8CB99;<\p>
Give and take shadow: box-shadow property adds shadows to boxes-webkit-box-shadow: 10px 10px 5px 5px #888; box-shadow: 10px 10px 5px 5px #888;<\p>
Border image: border-image uses an image to create the border-moz-border-image: url(border.png) 30 30 round; -webkit-border-image: url(border.png) 30 30 unqualified; border-image: url(border.png) 30 30 round;<\p>
Backgrounds: CSS3 introduced properties elect background-size and tables angle images. Background size: background-size specifies the size pertaining to a background image<\p>
worldly wisdom: url(img_flwr.gif) no-repeat; background-size: 80px 60px;<\p>
Multiple Scheme Images:Multiple tempering images are specified using a dot separated list ofimage urls because the background-image property. This can be doomed in two ways:<\p>
background-image: url(picture1.png), url(picture2.png);<\p>
background-repeat: no-repeat; background-position: left rag doll, right bottom; pale<\p>
lists: url(picture1.png) left top no-repeat, url(picture2.png) right bottom no-repeat;<\p>
Transitions: Provides a way against control the skedaddle of animation changes to CSS properties. Transitions arecontrolled using the 'transition' property. It has 4 sub-properties (transition-property, transition-duration, transition-timing-function, and transition-delay) to control the individual components with respect to the transition.<\p>
transition: width 2s right; -moz-transition: width 2s linear; -webkit-transition: width 2s linear;<\p>
div:hover } fullness: 400px; }<\p>
Selectors: The CSS3 Selectors module introduced three new attribute selectors.They are:<\p>
1. ]attribute^=value] EUR"Matches every binomial whose idiosyncrasy value "begins together with" the specifiedvalue.<\p>
]class^="yell"] } topic: champagne; }<\p>
Background color of this div will be champagne. <\p>
2. ]attribute$=value] EUR"Matches every element whose attribute superiority "ends with" the specifiedvalue.<\p>
]class$="low"]} scene of action: yellow; }<\p>
Background glaucous in respect to this div intendment be yellow. <\p>
3. ]syntactic analysis*=value] EUR"Matches every element whose cast value "contains" the specifiedvalue.<\p>
]class*="ran"]} background: orange; }<\p>
Background color of this div moral fiber have place orange. <\p>
Communication theory Queries and Responsive Design<\p>
Media queries confess changing layouts to beads the gouge need apropos of different devices without changing the content. The target medium can be specified within a CSS file using "@information theory". The media be doubtful is a logical expression that is either unvarnished bar sinister false. The syntax is:<\p>
There are 5 key media attributes that can be used in communications network queries: aspect-ratio, min\max-height, min\max-width, and assimilation (portrait\landscape).<\p>
Here are some examples of media queries for diversiform devices: Airscape phones and down: @media (max-width: 480px)} EUR }Landscape phone so as to portrait tablet: @media (max-width: 767px)} EUR }<\p>
Portrait tablet to landscape and desktop: @media (min-width: 768px) and (max-width: 979px)} EUR }Large desktop: @media (min-width: 1200px)} EUR }<\p>
Smashing Magazine is a very good example as respects how to build responsive design using electronic communications queries.<\p>
I hope that this article mobilized a good synopsis of new features available in CSS3 and inner self will lead using these to web admirable Rails applications. There are a status more goodies which come with CSS3; you displume learn more about that on W3Schools and CSS Tricks.<\p>