Pages

Sunday, June 15, 2014

How to use the text-decoration and the text-align property?


The text-align CSS property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

Example

 h1 {
    text-align: center;
}

p.date {
    text-align: right;
}

p.main {
    text-align: justify;
}

Text Decoration

The text-decoration property is used to set or remove decorations from CSS Text.
The text-decoration property is mostly used to remove underlines from links for design CSS purposes:

 a {
    text-decoration: none;
}

Wednesday, June 11, 2014

css Background Image - Shorthand property

 
As you'll be able to see from the examples on top of, there ar several CSS3 properties to think about once coping with backgrounds.
To shorten the CSS code, it's conjointly potential to specify all the properties in one single property. this can be known as a shorthand property.
The shorthand property for background is just "background":

body {
    background: #ffffff url("img_tree.png") no-repeat right top;
}

When victimization the shorthand CSS property the order of the property values is:
  •     background-color
  •     background-image
  •     background-repeat
  •     background-attachment
  •     background-position

It doesn't matter if one in every of the  css3 property values is missing, as long because the ones that ar gift ar during this order.

This example uses a lot of advanced CSS. Take a look: Advanced CSS example

Background Image - no-Repeat and Horizontally or Vertically Set position


By default, the background-image CSS property repeats a picture each horizontally and vertically.
Some pictures ought to be recurrent solely horizontally or vertically, or they're going to look strange, like this:

body {
    background-image: url("gradient.png");
}

If the image is recurrent CSS solely horizontally (repeat-x), the background can look better:

body {
    background-image: url("gradient.png");
    background-repeat: repeat-x;
}

Showing the image just the once is fixed by the background-repeat property:

body {
    background-image: url("img_tree.png");
    background-repeat: no-repeat;
}

In the CSS example higher than, the background image is shown within the same place because the text. we would like to vary the position of the image, so it doesn't disturb the CSS files an excessive amount of.The CSS position of the image is fixed by the background-position property:

body {
    background-image: url("img_tree.png");
    background-repeat: no-repeat;
    background-position: right top;
}

The css Background image define


The background-image CSS property specifies a picture to use because the background of a component.
By default, the image is continual therefore it covers the whole part.
The CSS background image for a page will be set like this:

Example

body {
    background-image: url("paper.gif");
}
Below is Associate in Nursing CSS example of a nasty combination of text and background image. The text is sort of not readable:

Example

body {
    background-image: url("bgdesert.jpg");
}

The css Background Color value in the body selector


The background-color css property specifies the background color of a part.

The background color of a page is outlined within the body css selector:

Example

body {
    background-color: #b0c4de;
}

With CSS, a color is most frequently such that by:
  •     a HEX worth - like "#ff0000"
  •     associate degree RGB worth - like "rgb(255,0,0)"
  •     a color name - like "red"
Look at CSS3 Rules Color Values for a whole list of attainable color values.
In the css example below, the h1, p, and div parts have completely different background colors:

Example

h1 {
    background-color: #6495ed;
}

p {
    background-color: #e0ffff;
}

div {
    background-color: #b0c4de;
}

Wednesday, June 4, 2014

How To do stylesheet CSS?

 

Three Ways to Insert CSS

  There are 3 ways of inserting a mode sheet for CSS :
  •     External sheet
  •     Internal sheet
  •     Inline vogue

External sheet

An external sheet is good once the fashion is applied to several pages. With AN external sheet, you'll modification the planning of a complete computing device by ever-changing only one file.

Each CSS files page should embody a link to the fashion sheet with the <link>  tag. The <link>  tag goes within the top section:

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

Internal sheet

An internal sheet ought to be used once one document encompasses a distinctive vogue. You outline internal designs within the head section of AN HTML pages, within the  tag, like this:

<head>
<style>
hr {color: sienna;}
p {margin-left: 20px;}
body {background-image: url("images/background.gif");}
</style>
</head>

Inline Styles

An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly!
To use inline styles, add the style attribute to the relevant tag. The style attribute can contain any CSS3 properties. The CSS Example shows how to change the color and the left margin of a paragraph:

 <p style="color:sienna;margin-left:20px;">This is a paragraph.</p>

CSS Introduction for beginner


 

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files    

 Styles solved  an enormous drawback

HTML was never meant to contain tags for format a document.
HTML was meant to outline the content of a document, like:
<h1>This is a heading.</h>
<p>This is a paragraph</p>
When tags like <font> and color attributes were further to the markup language 3.2 specification, it started a nightmare for net developers. Development of huge internet sites, wherever fonts and color data were further to each single page, became an extended and pricey method.
To solve this drawback, the planet Wide net syndicate (W3C) created CSS3.
In HTML 4.0, all format may well be far from the markup language document, and hold on in a very separate CSS file.
All browsers support CSS these days.

CSS Saves lots of Work!

CSS defines however HTML parts area unit to be displayed.

Styles area unit unremarkable saved in external CSS files. External vogue sheets alter you to alter the looks and layout of all the pages during a site, simply by redaction one single file!

CSS Ordinary Tutorial


In our CSS3 tutorial you will learn how to use CSS3 to control the style and layout of multiple Web pages all at once.

Examples in Each Chapter

This CSS tutorials contains hundreds of CSS3 examples.
With our online editor, you can edit the CSS and click on a button to view the result.

CSS3 Example

body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:21px;
}

 CSS3 References

At W3Schools you will find complete CSS3 references of all properties and selectors with syntax, examples, browser support, and more.

Tuesday, May 27, 2014

CSS - Cascade use Style Sheet

CSS defines however HTML components area unit to be displayed.CSS describes the visual vogue (appearance, layout, color, fonts) of HTML components.CSS was designed to separate document layout from document content (which greatly improved HTML flexibility and reduced HTML complexity).

CSS is simple to be told. you'll be able to use HTML component names as selectors, and list the design  CSS3 properties within kinky brackets:

CSS saves lots of work!

The CSS definitions area unit usually keep in external files. this allows an internet developer to alter the looks and layout of each page during a internet site, simply by writing one single file!

If you have got ever tried to alter the design of all components altogether your HTML pages, you perceive however you'll be able to save lots of labor by storing the design definitions in associate external file.

Friday, May 23, 2014

polished Drop Menu with CSS only make the build

Why can we like to use Drop Menu to show our navigation? as a result of, it saves house for our web site. If you’re building an internet site with several classes, you would like to use sink menu technique evidently. we are able to realize over net plenty of tutorials show North American country the way to build a Navigation with drop result by victimization JavaScript. Today, with this tutorial, you'll see a easiest method to create a same result by victimization CSS solely. With some CSS make-up, your menu are going to be elegant. undecided that one is best, except for certain it’s the best menu comes with drop effect: horizontal and vertical navigation.

Step 1: HTML Code

As I same on top of, this tutorial comes with CSS solely, you don’t have to be compelled to embrace any JavaScript to your  tag

  <ul id="navigation">
    <li class=""> <a href="#">Parent Item 1</a> </li>
    <li class=""> <a href="#">Parent Item 2</a>
      <ul>
        <li class=""> <a href="#">Child Item 1</a> </li>
        <li class=""> <a href="#">Child Item 2</a> </li>
        <li class=""> <a href="#">Child Item 3</a> </li>
        <li class=""> <a href="#">Child Item 4</a> </li>
        <li class=""> <a href="#">Child Item 5</a> </li>
      </ul>
    </li>
    <li class=""> <a href="#">Parent Item 3</a>
      <ul>
        <li class=""> <a href="#">Child Item 1</a> </li>
        <li class=""> <a href="#">Child Item 2</a> </li>
      </ul>
    </li>
    <li class=""> <a href="#">Parent Item 4</a> </li>
  </ul>

Step 2: CSS Code

Ya! consider CSS code below. i will be able to organize CSS code generator into every applied half. CSS code for the hold Navigation and Parent things is:

/* Navigation */
#navigation {
    list-style: none;
    font-family: "Century Gothic", Verdana, Arial, Sans-Serif;
    margin: 0;
    padding: 0;
    font-size: 1.2em;
}

/* CSS for each Parent Item */
#navigation li
{
    clear: both;
    height: 2em;
}

#navigation li a
{
    float: left;
    display: block;
    padding: 4px;
    text-decoration: none;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
    margin-right: 10px;
}

/* Change background color and font color of parent items when mouse hover */
#navigation li:hover a,
#navigation li a:hover
{
    background: #999;
    color: #fff;
}
 Finally, we've to reset and re vogue the link within every kid item as a result of the link
 already formatted higher than, you'll be able to realize it within css code block of Parent Item.
 
/* Reset and re style link of each child item */
#navigation li:hover ul li a,
#navigation ul li a
{
    display: inline;
    padding: 0 6px 0 0;
    float: none;
    text-transform: lowercase;
    color: #999;
    background: none;
}

#navigation li:hover ul li a:hover,
#navigation ul li a:hover
{
    background: none;
    color: #000;
}

That’s all we want to create the Navigation works.

[smart ads]

In this CSS tutorials, I solely show you ways to create the horizontal drop. you'll simple to try to to a similar with sink vertical menu result by downloading my code.

Advanced CSS Menu Trick originate


What we wish to try to to here, is rather than merely sterilization the state of the navigation item the user is presently rolling over, we wish to change the non navigation things similarly. this may facilitate focus the users attention on the item they need elect on, and make a brand new look and grieve the location overall. wish to examine it in action? cross-check my demo page before we have a tendency to begin.

The first step – CSS roll overs

The first step of the sport is building some CSS roll overs. we wish to stay things accessible thus I actually have opted to use Associate in Nursing IR technique. basically we have a tendency to produce a picture that has each the static, active and rolled over state all lined up next to every different. we have a tendency to then set the image because the background of the component, however the breadth is simply wide enough for one state of the image (so if the button image is 600px wide with all 3 states, we have a tendency to build the navigation component as a 200px wide button). we have a tendency to then set the text indent very high and overflow to hidden in order that it pushes the text out of the box. Then we have a tendency to solely see the image despite the fact that there's still hypertext markup language text on the page for search engines and accessibility.

The CSS

#main_nav { list-style: none; margin: 0; padding: 0; }
#main_nav li { float: left; }
#main_nav li a { text-indent: -999999px; overflow: hidden; display: block; height: 72px; } 

#home { background: url(../images/navigation/home.gif); width: 103px; }
#home.active { background: url../images/navigation/home.gif) -103px 0; } 
 

 The HTML

<ul id="main_nav">
   <li><a href="index.html" accesskey="3" id="home" title="Home Page">Home Page</a></li>
   <li><a href="about-us.html" accesskey="4" id="about" title="About 3.7 Designs">About Us</a></li>
   <li><a href="web-design.html" accesskey="5" id="webdesign" class="active" title="Web Design and Development">Web Design</a></li>
   <li><a href="graphic-design.html" accesskey="6" title="Graphic Design and Marketing" id="graphicdesign">Graphic Designs</a></li>
   <li><a href="keyword-optimization/michigan-seo.html" accesskey="7" title="Search Engine Optimization and Marketing" id="seo">Search Engine Optimization SEO</a></li>
   <li><a href="ann-arbor-marketing.html" accesskey="8" id="contact" title="Contact Us">Contact Us</a></li>
  </ul> 
 
Then {when we have a tendency to|once we|after we} wish to vary the state of the button we merely modify the background position to be -200px (or the dimensions of the button itself) actuation the various state of the button into read. the rationale for doing it this manner then merely swapping pictures, is that the latter methodology tends to form a flicker in some browsers.

At now the general public have it set in order that if Associate in Nursing item is hovered on (#home for example) it switches the background-image position. This creates the quality run of the mill css roll over. but we wish to try to to one thing else, one thing a lot of distinctive. we wish to own each roll over item on the menu amendment except the one you're hovering on. this needs a little CSS trickery!

IE7, Safari, Firefox, all support the :hover pseudo selectors thus let’s profit of that. What we'd like to try to to is have all the menu things amendment the background-image position once the menu item itself has been rolled over. Then the item that's hovered on is ready to own the background-position: 0px to stay it from moving once the remainder do.

The CSS

 #main_nav:hover li a#webdesign { background-position: -280px; }
 #main_nav:hover li a#home { background-position: -206px; }
 #main_nav:hover li a#graphicdesign { background-position: -340px; }
 #main_nav:hover li a#contact { background-position: -232px; }
 #main_nav:hover li a#about { background-position: -242px; }
 #main_nav:hover li a#seo { background-position: -540px; 

This pulls every menu item’s background position back once any of #main_nave has been hovered on. currently all we've got to try to to is ready the hovered things to own a background-position of 0

#home { background: url(../images/navigation/home.gif); width: 103px; }
 #home:hover { background: url(../images/navigation/home.gif) 0 0 !important; }

The HTML5  is set, already coded! currently you're able to rock and roll apart from that plagiary IE5.5+. fortuitously there has been a behavior file developed referred to as shoveler.ht c that may fix this issue. merely transfer it, and duplicate Associate in Nursing d paste the subsequent code into an IE5+ specific sheet.

Bubbler – CSS discourse bubble Generator


This is a trifle CSS speech bubble generator that I started a trifle whereas past (read ‘about a year’) and engineered with some J Query UI elements and a fairly hefty quantity of JavaScript. I’ve been tomfoolery with it latterly and have created it behave properly in a very ton additional things. sadly, round the same time that I started creating this I conjointly started fiddling with ‘magnifying’ my code. to chop a protracted story short, I lost the first “expanded” version of the speech bubble generator and had to form all my modifications to the hardly decipherable version :( *update* I’ve spent a while hunting and manually increasing the code for the speech bubble generator! this implies I will currently do bug fixes and different enhancements :D i assume I’ll simply ought to be additional careful in future :D

Anyway, plow ahead and create yourself some CSS speech bubbles! {they simply|they only|they merely|they simply|they solely} break out just one HTML5 tag, and therefore the CSS3 that gets generated is accessible from the pull down tab on the highest right.

Monday, May 19, 2014

CSS Layout Inventor | CSS architect


About the CSS Layout Generator

The CSS Layout Generator was 1st free by Tony Arlette in Gregorian calendar month 2003, since then over 871,000 layouts are generated. Updated in Gregorian calendar month 2010, HTML5 doc type will currently be designated and a straightforward HTML5 model with applicable tags are created. different hypertext mark-up language and XHT

The generator helps you produce the structure of your web site model victimization valid HTML and CSS.

You can produce a fluid or fastened breadth floated column layout, with up to three columns and with header and footer. Values is laid out in either pixels, ems or percentages.

The generator needs a contemporary DOM capable browser with JavaScript enabled.
Instructions

To create your layout choose the structural parts your web site needs (header, footer, columns). Then specify a size within the field provided and opt for a background color from the color someone below.

Info popups square measure out there wherever you see   icon, simply hover over it for additional data.

Join the CSS Forum to recommend changes or kindle facilitate wherever required.
ML doc types square measure still out there.

A presentation subject to Object Oriented CSS

 

What is Object adjusted CSS?


The idea of ‘Object adjusted Programming’, is widespread among developers, and forms the essential for any trendy programing language. options like knowledge abstraction, modularity and inheritance build it a favorite in committal to writing large-scale applications.

Object adjusted CSS, because the name suggests, is implementing the ideas of OOP in structuring and building CSS3 rules, that area unit simple to recycle, thereby reducing the loading time and increasing the performance of websites incredibly! The key purpose here is, to spot, build and elegance standard reusable ‘objects’ in a very page, and to recycle it in multiple instances by extending them with extra options where required. Here associate degree ‘object’ refers to the essential markup language markup and its CSS rules. Apparently, here, the key challenge goes to be, distinguishing the ‘object’ and building rules for it.

Following area unit some key aspects in object-oriented approach to CSS building:

  1.     produce a part library
  2.     Separate instrumentation and content / Avoid Location dependent designs
  3.     Separate Structure and skin
  4.     Extend base objects victimization category names
  5.     keep on with linguistics category names

Pros and Cons?


Following such associate degree approach of building CSS has its own pitfalls and blessings

Here area unit a couple of cases, wherever adopting such a framework ‘may’ backfire:

  1.     OOCSS is suited to actually massive websites / application that area unit crammed with reusable parts. it's going to not provide desired ends up in smaller websites and applications. thus decide reasonably reckoning on the dimensions of the add hand
  2.     If not neatly used, making the part library will end up to be a large number, and become a maintenance nightmare for alternative coders
  3.     Documentation could be a should. every block of code ought to be clearly commented out with the proper points for alternative coders to soak up the idea, that otherwise will become too tedious just in case of a information transition

Some obvious blessings of adopting this approach are:

  1.       Less lines of CSS3 code
  2.     Cleaner markup language markup, with logically smart category names and hierarchy
  3.  linguistics markup, means that a lot of SEO friendly pages
  4.  much better page optimization, with a lot of quicker loading times, since most of the parts area unit reused
  5.  climbable markup and CSS3 code generator, wherever a lot of parts will be interplanetary into the library while not heavy alternative parts, because the base objects area unit freelance of the other containers
  6.  simply theme-able layouts, since amendments to the bottom object will utterly change virtually the total presentation layer instantly

CSS3 set seascape two picture




Welcome to the CSS3_seascape_two example

This straightforward, fastened breadth web site example is free beneath a resourceful Commons Attribution three.0 License. this suggests you're absolve to transfer and use it for private and industrial comes. However, you need to leave the 'design from css3 templates.co.UK' link within the footer of the example.

This example is written entirely in HTML5 and CSS3. The photos shown during this example were taken by Pine Tree State. you'll be able to read a lot of free CSS3 internet templates here.

This example could be a absolutely documented five page web site, with associate examples page that offers samples of all the designs accessible with this style. there's additionally a operating PHP contact kind on the contact page. All of the seascapes were taken by Pine Tree State - use as you want.

Thursday, May 15, 2014

The Page Turn Transitions with CSS3

In the previous couple of years, we have seen lots of single page websites lying round the net, most of them exploitation JavaScript for a few transitions impact. Well, currently i am gonna teach you the way you'll have your own, however instead i will be exploitation CSS Transitions and also the :target property to try and do all the magic.
In the previous couple of years, we’ve seen lots of single page websites lying round the net, most of them exploitation JavaScript for a few transitions impact. Well, currently I’m gonna teach you the way you'll have your own, however instead I’ll be exploitation CSS3 Transitions and also the :target property to try and do all the magic.

Markup

The HTML5 can contain 5 main divisions: a header and also the four content sections. every of the content sections goes to own associate degree ID and also the category panel. Moreover, we are going to add another division within which is able to have the category content. the primary content section that is #home can solely have the content category and can not need an additional division:


<!-- Home -->
<div id="home" class="content">
    <h2>Home</h2>
    <p>Some content</p>
    <!-- ... -->
</div>
<!-- /Home -->
 
<!-- Portfolio -->
<div id="portfolio" class="panel">
    <div class="content">
        <h2>Portfolio</h2>
        <p>Some content</p>
        <!-- ... -->
    </div>
</div>
<!-- /Portfolio -->
 
<!-- About -->
<div id="about" class="panel">
    <div class="content">
        <h2>About</h2>
        <p>Some content</p>
        <!-- ... -->
    </div>
</div>
<!-- /About -->
 
<!-- Contact -->
<div id="contact" class="panel">
    <div class="content">
        <h2>Contact</h2>
        <p>Some content</p>
        <!-- ... -->
    </div>
</div>
<!-- /Contact -->

In the header we are going to have the most heading and also the navigation:

<!-- Header with Navigation -->
<div id="header">
    <h1>Page Transitions with CSS3</h1>
    <ul id="navigation">
        <li><a id="link-home" href="#home">Home</a></li>
        <li><a id="link-portfolio" href="#portfolio">Portfolio</a></li>
        <li><a id="link-about" href="#about">About Me</a></li>
        <li><a id="link-contact" href="#contact">Contact</a></li>
    </ul>
</div>
 
Now, the most plan is to use the pseudo-class :target so as to feature a transition to this section. during this CSS example, we are going to be slippery  up and down our sections.

CSS

First we are going to provide vogue to our header and also the navigation. we wish to stay these on an equivalent spot the least bit the time, despite the fact that everything else are moving.

#header{
    position: absolute;
    z-index: 2000;
    width: 235px;
    top: 50px;
}
#header h1{
    font-size: 30px;
    font-weight: 400;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
    padding: 40px;
    background: #000;
}
#navigation {
    margin-top: 30px;
    width: 235px;
    display:block;
    list-style:none;
    z-index:3;
}
#navigation a{
    color: #444;
    display: block;
    background: #fff;
    background: rgba(255,255,255,0.9);
    line-height: 50px;
    padding: 0px 20px;
    text-transform: uppercase;
    margin-bottom: 6px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    font-size: 14px;
}
#navigation a:hover {
    background: #ddd;
}
  
In order to vary the color of this item within the navigation, we’ll use the :target pseudo-class with the final relative selector to “get to” the various navigation item:

#home:target ~ #header #navigation #link-home,
#portfolio:target ~ #header #navigation #link-portfolio,
#about:target ~ #header #navigation #link-about,
#contact:target ~ #header #navigation #link-contact{
    background: #000;
    color: #fff;
}

And that’s all you would like. check up on the demos and you’ll see alternative samples of however you'll try this.

Hope you likeable this tutorial and perhaps you'll experiment together with your own effects.

sprightly make Web Banners With CSS3

Hey there folks! nowadays we’re reaching to take a glance at spicing up our internet banners, ads or any content for that matter, with CSS3 animations.

Firefox and Web Kit browsers are presently the sole browsers that support CSS animations, however we’ll take a glance at however we will simply create these ads additionally operate in alternative browsers (which I’ll dearly talk over with as eighteenth century browsers). However, don’t expect excellent support for all browsers (specifically that is seven and lower) once experimenting with trendy CSS Tutorials.

OK then, let’s build some kick-butt, animated internet banners!

The Markup

First off, we’re reaching to structure the ad’s components by parturition out the hypertext mark-up language. At this time, we’ll have to be compelled to assume through however we wish the animation to operate – as this may result the child/parent structure of our markup.
In order to grasp our markup structure, let’s focus in on the boat for a second:

<ul id="boat"> <!-- Groups the boat's elements -->
    <li> <!-- The boat itself -->
        <div id="question-mark"></div> <!-- The question mark (no crap) -->
    </li>
</ul>

Now, once you read the primary ad on the demo page, there ar three separate animations going down on the boat:

  1.  AN animation that slides the boat in from the left. this can be applied on to the unordered list (group).
  2.  AN animation that provides the boat a pleasant bobbing result – simulating the boat floating on water. this can be applied on to the list component (boat).
  3.  AN animation that fades within the punctuation mark. this can be applied on to the div (question mark).

The CSS

Before we tend to jump into the very fun stuff and begin invigorating, we tend to still have to be compelled to vogue the ad and are available up with a pure CSS retreat for browsers stuck within the eighteenth century.
Don’t worry tho' – neither folks need to be in this poor, developer’s shoes. this can be however we’ll give magnified browser support:

/* CORRECT WAY */
 
@keyframe our-fade-in-animation {
    0%   {opacity:0;}
    100% {opacity:1;}
}
 
div {
    opacity: 1; /* This div is visible by default */
    animation: our-fade-in-animation 1s 1;
}

As you'll be able to see, the div can show albeit the animation isn't ready to play. If the animation is in a position to play like God supposed, the div can instantly hide and therefore the epic animation you created can follow through.

Animated subject matter Tabs with CSS3

In this tutorial we tend to are getting to implement some straightforward CSS3 content tabs mistreatment radio buttons at the side of the :checked pseudo-class and relative combinatorial.
Content tabs are a awfully common and acquainted part in net style, and infrequently their end up to be pretty helpful. So, during this tutorial we tend to are getting to implement some straightforward CSS content tabs mistreatment radio buttons at the side of the :checked pseudo-class and relative combinatorial.

Note that the CSS3 properties can solely add browsers that support them.

The Markup

We will be mistreatment input components to attach to the division with the category content. The content division includes all of the “tab pages”. for every input part we’ll have a label part. All labels are going to be titled like tabs.


<section class="tabs">
    <input id="tab-1" type="radio" name="radio-set" class="tab-selector-1" checked="checked" />
    <label for="tab-1" class="tab-label-1">About us</label>
     
    <input id="tab-2" type="radio" name="radio-set" class="tab-selector-2" />
    <label for="tab-2" class="tab-label-2">How we work</label>
     
    <input id="tab-3" type="radio" name="radio-set" class="tab-selector-3" />
    <label for="tab-3" class="tab-label-3">References</label>
     
    <input id="tab-4" type="radio" name="radio-set" class="tab-selector-4" />
    <label for="tab-4" class="tab-label-4">Contact us</label>
             
    <div class="clear-shadow"></div>
                 
    <div class="content">
        <div class="content-1">
            <p>Some content</p>
        </div>
        <div class="content-2">
            <p>Some content</p>
        </div>
        <div class="content-3">
            <p>Some content</p>
        </div>
        <div class="content-4">
            <p>Some content</p>
        </div>
    </div>
</section>

Every input part encompasses a worth, and that we will forever create associate degree input elite by default by adding the checked attribute.

The CSS

The first factor we want to try and do is to outline some dimension and conceal the inputs by setting their opacity to 0:

tabs {
    position: relative;
    margin: 40px auto;
    width: 750px;
}
.tabs input {
    position: absolute;
    z-index: 1000;
    width: 120px;
    height: 40px;
    left: 0px;
    top: 0px;
    opacity: 0;
    cursor: pointer;
}
.tabs input#tab-2{
    left: 120px;
}
.tabs input#tab-3{
    left: 240px;
}
.tabs input#tab-4{
    left: 360px;
}

When we tend to need a content to seem (label clicked) we set the opacity to one and lift the z-index as a result of we wish this content division to air high of all the others:

.tabs input.tab-selector-1:checked ~ .content .content-1,
.tabs input.tab-selector-2:checked ~ .content .content-2,
.tabs input.tab-selector-3:checked ~ .content .content-3,
.tabs input.tab-selector-4:checked ~ .content .content-4 {
    z-index: 100;
    opacity: 1;
    transition: all ease-out 0.2s 0.1s;
}

In this CSS tutorials we tend to simply went through the fundamental example that may fade in/out the contents. you'll be able to realize a lot of designs and effects within the demos.

Wednesday, May 14, 2014

Creating an Impressive Product glass case with CSS3

impress.js could be a tiny, standalone library that produces it simple to style advanced CSS3 shows with attention-getting effects. however what if we tend to used impress.js for one thing aside from a presentation? this is often what we tend to do these days – we'll be spicing up a lucid recent product page with some CSS3 magic!

Using impress.js


With this little library, we will produce swish CSS3 transitions between the slides of our showcase. To do this, we've got to instruct impress.js on the way to orient the slides. this is often simple to try to to – we'll use knowledge attributes on the step dives. These attributes are translated into real CSS3 transformations by the library, reckoning on the present browser, and have an effect on the slide.
Impress.js supports variety of attributes:

    data-x, data-y, data-z can move the slide on the screen in 3D space;
    data-rotate, data-rotate-x, data-rotate-y rotate the part round the such that axis (in degrees);
    data-scale – enlarges or shrinks the slide.

The CSS3

To make the presentation work, we'll got to apply some CSS3 rules. the primary step is to vogue the presentation instrumentation and declare default styling for the slide parts.
assets/css/style.css



/*----------------------------
    Styling the presentation
-----------------------------*/

#impress:not(.impress-not-supported) .step{
    opacity:0.4;
}

#impress .step{
    width:700px;
    height: 600px;
    position:relative;
    margin:0 auto;

    -moz-transition:1s opacity;
    -webkit-transition:1s opacity;
    transition:1s opacity;
}

#impress .step.active{
    opacity:1;
}

#impress h2{
    font: normal 44px/1.5 'PT Sans Narrow', sans-serif;
    color:#444648;
    position:absolute;
    z-index:10;
}

#impress p{
    font: normal 18px/1.3 'Open Sans', sans-serif;
    color:#27333f;
    position:absolute;
    z-index:10;
}

#impress img{
    position:absolute;
    z-index:1;
}

As you'll see within the rules higher than, and within the HTML5 fragment within the starting of this tutorial, the #impress instrumentation is allotted a .impress-not-supported category. the category is removed providing the present browser supports the practicality needed for the library to run with success.