Showing posts with label CSS relative zoom. Show all posts
Showing posts with label CSS relative zoom. Show all posts

Monday 9 December 2013

CSS : Multiple Backgrounds



Another great time saver is the option of inserting multiple background directly from CSS, instead of using all kinds of hacks as we used to do before. The code is simple to write and to remember, and I am sure you will use it at some point in time.




.multiplebackgrounds {

height: 100px;

width: 200px;

padding: 20px;

background: url(top.gif) top right no-repeat,

url(bottom.gif) top left repeat-y,

url(middle.gif) bottom repeat-z;

}                                                                                                                                

































Other Topics

CSS3 : target-new Property

a
{
target-name:new;
target-new:tab;
}




The target-new property specifies whether new destination links should open in a new window or in a new tab of an existing window





Other Topics

CSS : Relative zoom


Right now, the "zoom in" graphic is linked to an alternate stylesheet with the following css:

body {
zoom: 1.2; -moz-transform: scale(1.2); -moz-transform-origin: 0 0}
} 

This works fine, but ideally I'd like to have the link trigger a relative zoom rather than an absolute zoom value -- so i would need to establish a variable that determined the user's current zoom level, and then increase that zoom by 120%. This way the same link could be clicked multiple times to increase the zoom incrementally.

Other Topics

CSS : Zoom property



The CSS3 equivalent is in the CSS 2D Transforms module, in particular transform: scale().
Because this module is still at Working Draft stage, you'll need browser-specific prefixes:
transform: scale(2);
-moz-transform: scale(2);
-webkit-transform: scale(2);
-o-transform: scale(2);
You may also need transform-origin (and browser-specific versions) to make it behave the same way as zoom, and you'll have to be careful to target zoom only at IE, because WebKit supports bothtransform and zoom so would double-scale.

CSS : Accordion Menu: CSS coding


CSS Accordion Menu: CSS coding








We will create a vertical Accordion Menu in this tutorial and in the next article we will show you how to convert it to a horizontal menu using the same HTML code we used in the last article.
For a simpler version of the CSS Accordion Menu please visit here.
CSS Accordion Menu: The CSS side
First we need to give our accordion a maximum height and a width. We don’t want the text in the <p> tags visible until the accordion has been hovered so we need to set our overflow to hidden. We will also get rid of the bullets from the list, the menu a background color and round off the corners off the menu to make it look a little softer.
So our beginning code should look something like this.
.accordion{
  width:600px;
  overflow:hidden;
  list-style:none;
  margin-bottom:10px;
  background:#ccc;

  -moz-border-radius:10px;
  -webkit-border-radius:10px;
  -o-border-radius:10px;
  border-radius:10px;
}
Next we need to set up the accordion list items CSS for their natural state.
.accordion li {
   height:20%;
   width:100%;
   -moz-transition:height 0.3s ease-out;
   -webkit-transition:height 0.3s ease-out;
   -o-transition:height 0.3s ease-out;
   transition:height 0.3s ease-out;
   overflow: hidden;
}

In this example we have 5 items in our menu so we divided it up into 5 equal parts, thus the 20% for our height. We want our sections to come right across so naturally we set that to 100%. Overflow was set to hidden as we do not want the text appear till we hover over it. The transition lines relate to the smooth sliding effect we are giving our accordion. This property was introduced with CCS3. In this case we have set the height to ease out over .3 of a second when when ever it is increasing or decreasing in height.
So that we retain the nice rounded of shape to our menu we will apply the following code to the first and last list items using the first-of-type and last-of-type psuedo-classes.
.accordion li:first-of-type{
   -moz-border-radius:10px 10px 0 0;
   -webkit-border-radius:10px 10px 0 0;
   -o-border-radius:10px 10px 0 0;
   border-radius:10px 10px 0 0;
}
.accordion li:last-of-type{
   -moz-border-radius:0 0 10px 10px;
   -webkit-border-radius:0 0 10px 10px;
   -o-border-radius:0 0 10px 10px;
   border-radius:0 0 10px 10px;
}

By rounding off the top of the first item and the bottom of our last item we maintain the shape we wanted.

.accordion:hover li{
  height:10%;
  width:100%;
}
.accordion li:hover{
  height:60%;
  width:100%;
}

And our CSS for a vertical accordion menu is complete. Well the basic structure is. In some cases you may have to fiddle with the figures for the sizes to get it right for you depending on your typography etc but that is the back structure.

Other Topics

Physics basic inventions and inventors

1.Which instrument is used to measure altitudes in aircraft's ? Audiometer Ammeter Altimeter Anemometer Explanation : ...