CodeStyleMenu

Tampilkan postingan dengan label css. Tampilkan semua postingan
Tampilkan postingan dengan label css. Tampilkan semua postingan

Selasa, 06 November 2012

CSS Background Properties


Css Background Properties

Property Description
background Sets all the background properties in one declaration
background-attachment Sets whether a background image is fixed or scrolls with the rest of the page
background-color Sets the background color of an element
background-image Sets the background image for an element
background-position Sets the starting position of a background image
background-repeat Sets how a background image will be repeated


background

Set all the background properties in one declaration:

body

{

background: 00ff00 url('smiley.gif') no-repeat fixed center;

}



Browser Support


The background property is supported in all major browsers.
Note: IE8 and earlier do not support multiple background images
on one element.
Note: The value "inherit" is not supported in IE7 and earlier. IE8
requires a !DOCTYPE. IE9 supports "inherit".


Definition and Usage

The background shorthand property sets all the background properties in one declaration.
The properties that can be set, are: background-color,
background-position, background-size, background-repeat, background-origin,
background-clip, background-attachment, and background-image.
It does not matter if one of the values above are missing, e.g. background:ff0000 url(smiley.gif); is allowed.

Default value: see individual properties
Inherited: no
Version: CSS1 + new properties in CSS3
JavaScript syntax: object.style.background="red url(smiley.gif) top left
no-repeat"




Syntax

background: color position size
repeat origin clip attachment
image
;


Value Description CSS
background-color Specifies the background color to be used 1
background-position Specifies the position of the background images 1
background-size Specifies the size of the background images 3
background-repeat Specifies how to repeat the background images 1
background-origin Specifies the positioning area of the background images 3
background-clip Specifies the painting area of the background images 3
background-attachment Specifies whether the background images are fixed or scrolls with the rest of the page 1
background-image Specifies ONE or MORE background images to be used 1


background-attachment

How to specify a fixed background-image:
body
{
background-image:url('smiley.gif');
background-repeat:no-repeat;
background-attachment:fixed;
}


Definition and Usage

The background-attachment property sets whether a background image is fixed or scrolls with the rest of the page.

Default value: scroll
Inherited: no
Version: CSS1
JavaScript syntax: object.style.backgroundAttachment="fixed"


Browser Support


The background-attachment property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8
requires a !DOCTYPE. IE9 supports "inherit".


Property Values


Value Description
scroll The background image scrolls with the rest of the page.
This is default
fixed The background image is fixed
inherit Specifies that the setting of the background-attachment
property should be inherited
from the parent element


background-color

Set the background-color of different elements:
body
{
background-color:yellow;
}
h1
{
background-color:00ff00;
}
p
{
background-color:rgb(255,0,255);
}


Definition and Usage

The background-color property sets the background color of an element.
The background of an element is the total size of the element, including
padding and border (but not the margin).
Default value: transparent
Inherited: no
Version: CSS1
JavaScript syntax: object.style.backgroundColor="00FF00"



Browser Support


The background-color property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8
requires a !DOCTYPE. IE9 supports "inherit".


Tips and Notes

Tip: Use a background color and a text color that makes the text easy
to read.


Property Values

Value Description
color Specifies the background color.
transparent Specifies that the background color should be transparent.
This is default
inherit Specifies that the background color should be inherited
from the parent element


background-image

Set a background-image for the body element:
body
{
background-image:url('paper.gif');
background-color:cccccc;
}


Definition and Usage


The background-image property sets one or more background images for an element.
The background of an element is the total size of the element, including
padding and border (but not the margin).
By default, a background-image is placed at the top-left corner of an
element, and repeated both vertically and horizontally.
Default value: none
Inherited: no
Version: CSS1
JavaScript syntax: object.style.backgroundImage="url(stars.gif)"




Browser Support


The background-image property is supported in all major browsers.
Note: IE8 and earlier do not support multiple background images
on one element.
Note: The value "inherit" is not supported in IE7 and earlier. IE8
requires a !DOCTYPE. IE9 supports "inherit".


Tips and Notes

Tip: Always set a background-color to be used if the image is unavailable.



Property Values


Value Description
url('URL') The URL to the image. To specify more than one image, separate the URLs
with a comma
none No background image will be displayed. This is default
inherit Specifies that the background image should be inherited
from the parent element


background-position

How to position a background-image:
body
{
background-image:url('smiley.gif');
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}



Definition and Usage

The background-position property sets the starting position of a background image.
Note: For this to work in Firefox and Opera, the background-attachment
property must be set to "fixed".

Default value: 0% 0%
Inherited: no
Version: CSS1
JavaScript syntax: object.style.backgroundPosition="center"




Browser Support


The background-position property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8
requires a !DOCTYPE. IE9 supports "inherit".


Property Values


Value Description
left top
left center
left bottom
right top
right center
right bottom
center top
center center
center bottom
If you only specify one keyword, the other value will be "center"
x% y% The first value is the horizontal position and the second
value is the vertical. The top left corner is 0% 0%.
The right bottom corner is 100% 100%. If you only specify one
value, the other value will be 50%. . Default value is: 0% 0%
xpos ypos The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and positions
inherit Specifies that the setting of the background-position
property should be inherited
from the parent element


background-repeat

Repeat a background-image only vertically:
body
{
background-image:url('paper.gif');
background-repeat:repeat-y;
}


Definition and Usage

The background-repeat property sets if/how a background image will be
repeated.
By default, a background-image is repeated both vertically and horizontally.
Default value: repeat
Inherited: no
Version: CSS1
JavaScript syntax: object.style.backgroundRepeat="repeat-y"




Browser Support


The background-repeat property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8
requires a !DOCTYPE. IE9 supports "inherit".


Tips and Notes

Tip: The background image is placed according to the
background-position property. If no background-position is specified, the image
is always placed at the element’s top left corner.


Property Values


Value Description
repeat The background image will be repeated both vertically and
horizontally. This is default
repeat-x The background image will be repeated only horizontally
repeat-y The background image will be repeated only vertically
no-repeat The background-image will not be repeated
inherit Specifies that the setting of the background-repeat
property should be inherited
from the parent element

CSS 3 Style Background



CSS Background

CSS background properties are used to define the background effects of an element.

CSS properties used for background effects:

  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

Background Color

The background-color property specifies the background color of an element.

The background color of a page is defined in the body selector:

body {background-color:#b0c4de;}

With CSS, a color is most often specified by:

  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
  • a color name - like "red"

In the example below, the h1, p, and div elements have different background colors:

h1 {background-color:#6495ed;}

p {background-color:#e0ffff;}

div {background-color:#b0c4de;}

Background Image

The background-image property specifies an image to use as the background of an element.

By default, the image is repeated so it covers the entire element.

The background image for a page can be set like this:

body {background-image:url('paper.gif');}

Below is an example of a bad combination of text and background image. The text is almost not readable:

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


Background Image - Repeat Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.

Some images should be repeated only horizontally or vertically, or they will look strange, like this: 

body

{

background-image:url('gradient2.png');

}

If the image is repeated only horizontally (repeat-x), the background will look better:

body

{

background-image:url('gradient2.png');

background-repeat:repeat-x;

}

Background Image - Set position and no-repeat

Remark When using a background image, use an image that does not disturb the text.

Showing the image only once is specified by the background-repeat property:

body

{

background-image:url('img_tree.png');

background-repeat:no-repeat;

}

In the example above, the background image is shown in the same place as the text. We want to change the position of the image, so that it does not disturb the text too much.

The position of the image is specified by the background-position property:

body

{

background-image:url('img_tree.png');

background-repeat:no-repeat;

background-position:right top;

}

Background - Shorthand property

As you can see from the examples above, there are many properties to consider when dealing with backgrounds.

To shorten the code, it is also possible to specify all the properties in one single property. This is called a shorthand property.

The shorthand property for background is simply "background":

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

When using the shorthand property the order of the property values is:

  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

It does not matter if one of the property values is missing, as long as the ones that are present are in this order.


All CSS Background Properties

Property Description
background Sets all the background properties in one declaration
background-attachment Sets whether a background image is fixed or scrolls with the rest of the page
background-color Sets the background color of an element
background-image Sets the background image for an element
background-position Sets the starting position of a background image
background-repeat Sets how a background image will be repeated

Read More » css-backround-properties

CSS Basic + CSS3 Update


» Intro »

As the popularity of CSS grows, so does interest in making additions to the specification. Rather than attempting to shove dozens of updates into a single monolithic specification, it will be much easier and more efficient to be able to update individual pieces of the specification. Modules will enable CSS to be updated in a more timely and precise fashion, thus allowing for a more flexible and timely evolution of the specification as a whole.

For resource constrained devices, it may be impractical to support all of CSS. For example, an aural browser may be concerned only with aural styles, whereas a visual browser may care nothing for aural styles. In such cases, a user agent may implement a subset of CSS. Subsets of CSS are limited to combining selected CSS modules, and once a module has been chosen, all of its features must be supported.

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

CSS Syntax

A CSS rule has two main parts: a selector, and one or more declarations:


SelectorDeclarationDeclaration
h1{font-size:12px; color:#white}
↑↑↑↑
PropertiValuePropertiValue

The id and class Selectors


In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class".

The id Selector

The id selector is used to specify a style for a single, unique element.

The id selector uses the id attribute of the HTML element, and is defined with a "#".
The style rule below will be applied to the element with id="test":
#test
{
text-align:center;
color:red;
}
Do NOT start an ID name with a number! It will not work in Mozilla/Firefox.

The class Selector


The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.

This allows you to set a particular style for many HTML elements with the same class.

The class selector uses the HTML class attribute, and is defined with a "."

In the example below, all HTML elements with class="center" will be center-aligned:


.center {text-align:center;}
You can also specify that only specific HTML elements should be affected by a class.

Three Ways to Insert CSS

There are three ways of inserting a style sheet:
  • External style sheet
  • Internal style sheet
  • Inline style

External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
<head>

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

</head>

An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}

Remark Do not add a space between the property value and the unit (such as margin-left:20 px). The correct way is: margin-left:20px


Internal Style Sheet

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>


Inline Styles

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The 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>


Multiple Style Sheets

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet.
For example, an external style sheet has these properties for the h3 selector:
h3
{
color:red;
text-align:left;
font-size:8pt;
}
And an internal style sheet has these properties for the h3 selector:
h3
{
text-align:right;
font-size:20pt;
}

If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
color:red;
text-align:right;
font-size:20pt;

The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.

Multiple Styles Will Cascade into One

Styles can be specified:
  • inside an HTML element
  • inside the head section of an HTML page
  • in an external CSS file

Tip: Even multiple external style sheets can be referenced inside a single HTML document.


Cascading order

What style will be used when there is more than one style specified for an HTML element?

Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
  1. Browser default
  2. External style sheet
  3. Internal style sheet (in the head section)
  4. Inline style (inside an HTML element)

So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).

Note: If the link to the external style sheet is placed after the internal style sheet in HTML <head>, the external style sheet will override the internal style sheet!

Senin, 29 Oktober 2012

Membuat animasi bergerak dengan css3 tanpa gambar dan javascript

Di kesempatan kali ini saya mau berbagi trik lagi menggunakan efek animasi css3. Bagaimana membuat sebuah objek bergerak tanpa javasript dan gambar seperti objek di bawah ini?

CodeStyle
Animation


Tentu kita berpikir objek ini terbentuk dari gambar atau dari pengaruh javascript yang di tuliskan pada halaman artikel atau yang di tanam pada pengaturan kode html. Hilangkan prasangka tersebut, karena css3 mampu melakukan hal ini.

Coba simak kode berikut sebagai referensi dan praktekan pada browser anda.

Berikut Kodenya :
<style>
#animated_div {
width:100px;
height:60px;
background:#92B901;
color:#000;
position:relative;
font-weight:bold;
font-size:20px;
text-shadow:1px 1px 3px #000;
margin-left:10px;
animation:animated_div 5s 1;
-moz-animation:animated_div 5s 1;
-webkit-animation:animated_div 5s 1;
-o-animation:animated_div 5s 1;
border-radius:5px;
-webkit-border-radius:5px;
box-shadow:1px 4px 8px #000;
}


@keyframes animated_div
{
0% {transform: rotate(0deg);left:0px;}
25% {transform: rotate(20deg);left:0px;}
50% {transform: rotate(0deg);left:500px;}
55% {transform: rotate(0deg);left:500px;}
70% {transform: rotate(0deg);left:500px;background:#1ec7e6;}
100% {transform: rotate(-360deg);left:0px;}
}

@-webkit-keyframes animated_div
{
0% {-webkit-transform: rotate(0deg);left:0px;}
25% {-webkit-transform: rotate(20deg);left:0px;}
50% {-webkit-transform: rotate(0deg);left:500px;}
55% {-webkit-transform: rotate(0deg);left:500px;}
70% {-webkit-transform: rotate(0deg);left:500px;background:#1ec7e6;}
100% {-webkit-transform: rotate(-360deg);left:0px;}
}

@-moz-keyframes animated_div
{
0% {-moz-transform: rotate(0deg);left:0px;}
25% {-moz-transform: rotate(20deg);left:0px;}
50% {-moz-transform: rotate(0deg);left:500px;}
55% {-moz-transform: rotate(0deg);left:500px;}
70% {-moz-transform: rotate(0deg);left:500px;background:#1ec7e6;}
100% {-moz-transform: rotate(-360deg);left:0px;}
}

@-o-keyframes animated_div
{
0% {transform: rotate(0deg);left:0px;}
25% {transform: rotate(20deg);left:0px;}
50% {transform: rotate(0deg);left:500px;}
55% {transform: rotate(0deg);left:500px;}
70% {transform: rotate(0deg);left:500px;background:#1ec7e6;}
100% {transform: rotate(-360deg);left:0px;}
}

</style>
<div id="animated_div"><a title='membuat animasi dengan css3' href='http://codestyle.blogspot.com'>CodeStyle</a><br><span style="font-size:12px;color:white;">Animation</span></div>

demikian posting kali ini. semoga saja bermanfaat buat kita semua, hitung-hitung saling berbagi ilmu..

Sabtu, 27 Oktober 2012

Spyning icon Rotasi pada gambar menggunakan css3

Kali ini kita akan membuat rotasi pada gambar menggunakan kode html dan css3. Trik ini dapat anda gunakan untuk menu animasi, header animasi dan lain-lain yang ada animasinya.


Seperti biasanya kita mulai dengan kode CSS..
Berikut kode CSS3 nya :
<style>

#socialicons img{ /* 1st set of icons. Rotate them 360deg onmouseover and out */
-moz-transition: all 0.8s ease-in-out;
-webkit-transition: all 0.8s ease-in-out;
-o-transition: all 0.8s ease-in-out;
-ms-transition: all 0.8s ease-in-out;
transition: all 0.8s ease-in-out;
}

#socialicons img:hover{
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}

#socialicons2 img{ /* 2nd set of icons. Rotate them 60deg onmouseover and out */
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}

#socialicons2 img:hover{
-moz-transform: rotate(70deg);
-webkit-transform: rotate(70deg);
-o-transform: rotate(70deg);
-ms-transform: rotate(70deg);
transform: rotate(70deg);
}

#socialicons3 img{ /* 3rd set of icons. Rotate them -360deg onmouseover ONLY. Note where the "transition prop is added */
}

#socialicons3 img:hover{
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
-moz-transform: rotate(-360deg);
-webkit-transform: rotate(-360deg);
-o-transform: rotate(-360deg);
-ms-transform: rotate(-360deg);
transform: rotate(-360deg);
}

</style>


Berputar bolak balik 360 derajat jika mouse mendekati objek
<div id="socialicons">
<a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/rss.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/delicious.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/facebook.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/twitter.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/yahoo.png" /></a></div>


Berputar 60 derajar jika mouse mendekati objek atau menjauhi
<div id="socialicons2">
<a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/rss.png" /></a>
<a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/delicious.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/facebook.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/twitter.png" /></a><a href="http://codestyle.blogspot.com/">
<img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/yahoo.png" /></a></div>


Berputar terbalik 360 derajar jika mouse mendekati objek saja
<div id="socialicons3">
<a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/rss.png" /></a>
<a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/delicious.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/facebook.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/twitter.png" /></a><a href="http://codestyle.blogspot.com/"><img border="0" src="http://www.dynamicdrive.com/cssexamples/media/socialicons/64x64/yahoo.png" /></a></div>

Bagaimana, mudah bukan? segalanya kini lebih mudah dengan adanya fitur html5 dan css3. semoga bermanfaat ...

Sabtu, 20 Oktober 2012

Membuat Layout Koran dengan CSS3 Update

Pada umumnya kita menggunakan tag tabel untuk membuat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :


dan untuk kode htmlnya adalah :


* ISI TULISAN di ganti dengan isi posting anda.

bagaimana hasilnya? Mudah bukan?
Sebarlah artikel ini jika bermanfaat dan jangan sungkan sungkan bertanya jika mendapatkan kendala melalui kolom komentar.

Hasilnya :

Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :Pada umumkya kita menggunakan tag tabel untuk membtat kolom. Dengan adanya css3 hal ini dapat di atasi dengan trik menggunakan tag coloumn.

Kali ini kita akan membuat layout koran dengan kode css sebagai berikut :

Kamis, 18 Oktober 2012

Membuat pop up slider tampilan android di blog

Dari judulnya saja udah menarik, bagaimana nanti praktiknya yah.... tanpa basa basi, tanpa padang bulu,,,
langsung kita sikat saja kodenya !!!
Sikat tapi jangan di makan yahh ....

berawal dari kode css :
<style>
#page-wrap {width: 720px; margin: 0 auto; padding:300px; position:fixed; background:transparant center;}
#well {
padding: 14px 20px 20px 20px;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;

background: -moz-linear-gradient(top, #010101, #181818);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #010101),color-stop(1, #181818));

border: 2px solid #454545;
overflow: hidden;

-webkit-user-select: none;
}
#codestyle {
background: -moz-linear-gradient(left, #4d4d4d, 0.4, #4d4d4d, 0.5, white, 0.6, #4d4d4d, #4d4d4d);
background: -webkit-gradient(linear,left top,right top,color-stop(0, #4d4d4d),color-stop(0.4, #4d4d4d),color-stop(0.5, white),color-stop(0.6, #4d4d4d),color-stop(1, #4d4d4d));

-moz-background-clip: text;
-webkit-background-clip: text;

-moz-text-fill-color: transparent;
-webkit-text-fill-color: transparent;

-webkit-animation: slidetounlock 5s infinite;

font-size: 80px;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300; color:#666;
padding: 0;
width: 200%;

-webkit-text-size-adjust: none;
}
#slider {
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8zdI1ln-Pyb-BgKVB03aGDoZmdHp_sSNGzQpPL13n7sRAahEKjLU3jRiFhZLU_Q6EaXu-5Bd2jsfFFyCJda9a2BjM4rS8bttgs5lwiK2L_XbELwXh1ltR-1N6hAfTPBCQeZNzzWOnTVg-/s1600/arrow.png) no-repeat;
width: 146px;
height: 98px;
display: inline-block;
vertical-align: middle;
line-height: 1;
}
@-webkit-keyframes slidetounlock {
0% {
background-position: -820px 0;
}
100%{
background-position: 820px 0;
}
}
</style>




Berlanjut dengan kode 3 buah script yang tanpa repot dan tanpa ragu kamu hanya copas ajah hehe... :
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js'></script>
<script src='http://ycusoy.googlecode.com/files/code%2Bstyle%2Bslide.js'></script>

Lalu kode htmlnya yang nanti di paste pada halaman posting...
<div id="page-wrap">
<div id="well">
<div id='codestyle'><strong id="slider"></strong> <span>slide to unlock</span></div>
</div>
</div>


bagaimana bro and sista... mudah bukan ?? silahkan praktekan dan sebar luaskan artikel ini. dan jangan lupa yah sumbernya ...

contohnya pasti udah kamu lihat kan ??





slide to unlock

Membuat tombol menu unik dengan javascript+css+html

Pada pagi ini kita akan membuat tombol menu yang unik dan bisa di jadikan referensi kamu untuk memilih menu mana yang kamu suka, jika tertarik boleh langsung praktekan...


berikut kode css nya :
<style>
a { text-decoration: none; }
ul { list-style: none; }
.box { background: #a7a7a7; -moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 10px; margin: 0 0 15px 0; }
.box ul li { font-size: 11px; margin: 0; border-bottom: 1px solid #666; }
.box ul li a { color: #222; display: block; padding: 4px 4px; margin: 0;
border-bottom: 1px solid #ccc; }
.box ul li:last-child,
.box ul li:last-child a { border: none; }
.box ul li a:hover { background: #ccc; text-decoration: none; }
#catNav { background: #494949; padding: 5px 5px 5px 37px;
-moz-border-radius: 5px; -webkit-border-radius: 5px;
overflow: hidden; margin: 0 0 10px 0; }
#catNav li { display: inline; }
#catNav li a { display: block; width: 50px; height: 50px; text-indent: -9999px;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjglnlTqDVsNkXMWSd8qUvRI1fdxFlm5WCFJqoRvNHhE7_LdFrTjilBSJPd1mvog6RynMDI2mzG678mjjsA_O0OCq-PMHx6NvmPoQ4KGvXbkTD37cj9gTFncejYr7AhkX8r7N9jK5tAkCMC/s1600/tombol%252Bunik%252Bcode%252Bstyle.png); float: left;
border: none; padding: 0; }
#catNav li a#list-satu-button { background-position: -50px -50px; }
#page-wrap #catNav li.activeCatButton a#list-satu-button { background-position: -50px -100px; }
#catNav li a#list-satu-button:hover { background-position: -50px 0px; }
#catNav a#list-dua-button { background-position: -100px -50px; }
#page-wrap #catNav li.activeCatButton a#list-dua-button { background-position: -100px -100px; }
#catNav li a#list-dua-button:hover { background-position: -100px 0px; }
#catNav a#list-tiga-button { background-position: 0px -50px; }
#page-wrap #catNav li.activeCatButton a#list-tiga-button { background-position: 0px -100px; }
#catNav li a#list-tiga-button:hover { background-position: 0px 0px; }
#catNav a#list-empat-button { background-position: -150px -50px; }
#page-wrap #catNav li.activeCatButton a#list-empat-button { background-position: -150px -100px; }
#catNav li a#list-empat-button:hover { background-position: -150px 0px; }
</style>

Sedangkan untuk sriptnya adalah :
<script src="http://ycusoy.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
// ycusoy creator
$(function(){

$("#list-dua").hide();
$("#list-tiga").hide();
$("#list-empat").hide();
$("#list-satu-button").click(function(){
$(".cat-list").slideUp(600);
$("#list-satu").slideDown(600);
});

$("#list-dua-button").click(function(){
$(".cat-list").slideUp(600);
$("#list-dua").slideDown(600);
});

$("#list-tiga-button").click(function(){
$(".cat-list").slideUp(600);
$("#list-tiga").slideDown(600);
});

$("#list-empat-button").click(function(){
$(".cat-list").slideUp(600);
$("#list-empat").slideDown(600);
});

$("#catNav li a").click(function() {
$("#catNav li").removeClass("activeCatButton");
$(this).parent().addClass("activeCatButton");
});
});
</script>

Dan yang terakhir kode htmlnya :
<div id="page-wrap">

<div class="box">
<ul id="catNav">
<li class="activeCatButton"><a id="list-satu-button">Apple</a></li>
<li><a id="list-dua-button">Linux</a></li>
<li><a id="list-tiga-button">Microsoft</a></li>
<li><a id="list-empat-button">News</a></li>
</ul>

<ul class="cat-list" id="list-satu">
<li><a href="#">Contoh Ringkas baris satu</a></li>
<li><a href="#">Contoh Ringkas baris satu</a></li>
<li><a href="#">Contoh Ringkas baris satu</a></li>
<li><a href="#">Contoh Ringkas baris satu</a></li>
<li><a href="#">Contoh Ringkas baris satu</a></li>
</ul>
<ul class="cat-list" id="list-dua">
<li><a href="#">Contoh Ringkas baris dua</a></li>
<li><a href="#">Contoh Ringkas baris dua</a></li>
<li><a href="#">Contoh Ringkas baris dua</a></li>
<li><a href="#">Contoh Ringkas baris dua</a></li>
<li><a href="#">Contoh Ringkas baris dua</a></li>
</ul>
<ul class="cat-list" id="list-tiga">
<li><a href="#">Contoh Ringkas baris tiga</a></li>
<li><a href="#">Contoh Ringkas baris tiga</a></li>
<li><a href="#">Contoh Ringkas baris tiga</a></li>
<li><a href="#">Contoh Ringkas baris tiga</a></li>
<li><a href="#">Contoh Ringkas baris tiga</a></li>
</ul>
<ul class="cat-list" id="list-empat">
<li><a href="#">Contoh Ringkas baris empat</a></li>
<li><a href="#">Contoh Ringkas baris empat</a></li>
<li><a href="#">Contoh Ringkas baris empat</a></li>
<li><a href="#">Contoh Ringkas baris empat</a></li>
<li><a href="#">Contoh Ringkas baris empat</a></li>
</ul>

</div>

</div>

Bagaimana, Apakah kamu berhasil membuatnya. Oke sekian dulu postingan kali ini. sampai jumpa ...

contoh :





dan jangan lupa tinggalkan komentar jika masih dikau sempat..



Membuat Tombol Source Code Html dengan css+ javascript+html

Nah pada kesempatan kali ini kita akan membuat sendiri tools seperti layaknya firebug addon pada mozila, gunanya untuk melihat isi html blog kita dengan javascript, css dan html.

Baiklah untuk kode css nya sebagai berikut :
<style type="text/css">
* { margin: 0; padding: 0; }
body { font: 14px Georgia, serif; }
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
#page-wrap { width: 960px; margin: 60px auto; }
a img { border: 0; }
h1 { font: bold 32px Helvetica, Arial, Sans-Serif; letter-spacing: -1px; margin: 50px 0 20px 0; }
p { margin: 0 0 20px 0; }
/* Pretty printing styles. Used with prettify.js. */
.str { color: #61ff74; }
.kwd { color: #ea5eff; }
.com { color: white; }
.typ { color: red; }
.lit { color: red; }
.pun { color: white; }
.pln { color: white; }
.tag { color: #ffab58; }
.atn { color: #fabb4e; }
.atv { color: #ffd996; }
.dec { color: red; }
pre.prettyprint { padding: 2px; border: 1px solid #888 }
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: none }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }
@media print {
.str { color: #060; }
.kwd { color: #006; font-weight: bold; }
.com { color: #600; font-style: italic; }
.typ { color: #404; font-weight: bold; }
.lit { color: #044; }
.pun { color: #440; }
.pln { color: #000; }
.tag { color: #006; font-weight: bold; }
.atn { color: #404; }
.atv { color: #060; }
}
#source-code { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); }
#source-code:target { display: block; }
#source-code pre { padding: 20px; font: 14px/1.6 Monaco, Courier, MonoSpace; margin: 50px auto; background: rgba(0,0,0,0.8); color: white; width: 80%; height: 80%; overflow: auto; }
#source-code pre a, #source-code pre a span { text-decoration: none; color: #00ccff !important; }
#x { position: absolute; top: 30px; left: 10%; margin-left: -41px; }
.button { background: #00ccff; padding: 10px 20px; color: white; text-decoration: none; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; }
</style>

Dan untuk scriptnya (javascriptnya) seperti ini :
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://ycusoy.googlecode.com/files/codestylesource.js"></script>
<script>
$(function() {
$("<pre />", {
"html": '&lt;!DOCTYPE html>\n&lt;html>\n' +
$("html")
.html()
.replace(/[<>]/g, function(m) { return {'<':'&lt;','>':'&gt;'}[m]})
.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>') +
'\n&lt;/html>',
"class": "prettyprint"
}).appendTo("#source-code");

prettyPrint();
});
</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-30788315-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

Dan yang terakhir adalah kode htmlnya :
<div id="page-wrap">
<h1>Code Style Model Baru</h1>
<p>Klik tombol untuk melihat dalam tampilan modern kode html. Ini menggunakan js dan css3. </p>
<a class="button" href="#source-code" id="view-source">Model Baru</a>
<h1>Code Style Model Lama</h1>
<p>Hanya bekerja pada Mozila dan Chrome. Mungkin bisa juga yang lainnya, tapi tidak untuk safari dan opera.</p>
<a class="button" onClick='window.location="view-source:" + window.location.href'>Model Lama</a>
<div id="source-code">
<a href="#" id="tutup"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq6YfPY-h61TJ6a9FaAjVrRs4QauHKJU-LmKImS6x5-WAE-8VP58YOVOOuv9xspgnUZz_sm_YKmMgWoBrgaTx2ZcT0J9HYtPQruWRglwnoidwcglss4FRvKX-Ie_zQ8AbFTUAx8Axqw5hh/s1600/x.png" alt="close"></a>
</div>
</div>


Contoh :




Jadi malu nih, kelihatan semua codestyle yang berantakan hehehe,,,, semoga manfaat ya...(jangan lupa tingalkan komentar yahhh))

Code Style Model Baru

Klik tombol untuk melihat dalam tampilan modern kode html.
Ini menggunakan js dan css3.

Model Baru

Code Style Model Lama

Hanya bekerja pada Mozila dan Chrome.
Mungkin bisa juga yang lainnya, tapi tidak untuk safari dan opera.

Model Lama
close

Rabu, 17 Oktober 2012

Membuat transisi gambar gelembung dengan css html

Kali ini kita akan membuat transisi gambar menggembung seperti buih buih busa sabun cuci r*n*o.. Hehe..

Hasilnya dapat kamu terapkan pada semua gambar dalam blog kamu maupun hanyalah sebagai selir ratu..
Eh kok salah.. Ralat!
Maupun sebagai widget..

Untuk kode css nya nih dia :
<style type="text/css">

.bubblewrap{
list-style-type:none;
margin:0;
padding:0;
}

.bubblewrap li{
display:inline;
width: 65px;
height:60px;
}

.bubblewrap li img{
width: 55px; /* width of each image.*/
height: 60px; /* height of each image.*/
border:0;
margin-right: 12px; /*spacing between each image*/
-moz-transition:-moz-transform 0.1s ease-in; /*animate transform property */
-webkit-transition:-webkit-transform 0.1s ease-in;
-o-transition:-o-transform 0.1s ease-in; /*animate transform property in Opera */
}

.bubblewrap li img:hover{
-moz-transform:scale(1.8); /*scale up image 1.8x*/
-webkit-transform:scale(1.8);
-o-transform:scale(1.8);
}

</style>

Dan untuk kode htmlnya :
<ul class="bubblewrap">
<li><a href="URL MEDIA KAMU"><img src="URL GAMBAR KAMU" title="Add to Stumbleupon" /></a></li>
<li><a href="URL MEDIA KAMU"><img src="URL GAMBAR KAMU" title="Add to Facebook" /></a></li>
<li><a href="URL MEDIA KAMU"><img src="URL GAMBAR KAMU" title="Add to Digg" /></a></li>
<li><a href="URL MEDIA KAMU"><img src="URL GAMBAR KAMU" title="Add to Twitter" /></a></li>
<li><a href="URL MEDIA KAMU"><img src="URL GAMBAR KAMU" title="Add RSS Feed" /></a></li></ul>

* jangan lupa URL GAMBAR KAMU dan URL MEDIA KAMU di ubah ya..
nah.. Bagaimana hasilnya,,?
Contoh :




oke plend.
Jika artikel ini bermanfaat, jangan lupa tinggalkan jejak dalam kolom komentar...

Membuat menu opaque unik dengan css

Tampilan menu yang indah pada blog merupakan nuansa tersendiri buat yang empunya blog atau visitor yang datang berkunjung.
Mata tak dapat berdusta, karna dia tak dapat bicara...Hahaha

oke lanjut sesuai judul postingan..
Tempelkan kode berikut dalam template anda sebelum kode </head>
<style type="text/css">

div.bottombar{ /* bar that runs across the bottom of the menu */
height: 10px;
background: #1a1109;
}

ul.semiopaquemenu{ /* main menu UL */
font: bold 14px Georgia ;
width: 100%;
background: #b1e958;
padding: 11px 0 8px 0; /* padding of the 4 sides of the menu */
margin: 0;
text-align: left; /* set value to "left", "center", or "right" to align menu accordingly */
}

ul.semiopaquemenu li{
display: inline;
}

ul.semiopaquemenu li a{
color:black;
padding: 6px 8px 6px 8px; /* padding of the 4 sides of each menu link */
margin-right: 15px; /* spacing between each menu link */
text-decoration: none;
}

ul.semiopaquemenu li a:hover, ul.semiopaquemenu li a.selected{
color: black;
background: url(data:image/svg xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjgyIi8 CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMC4xNiIvPgogIDwvbGluZWFyR3JhZGllbnQ CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc ); /* IE9 SVG equivalent of linear gradients */
background: -moz-linear-gradient(top, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.16) 100%); /* fade from white (0.82 opacty) to 0.16 opacity */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.82)), color-stop(100%,rgba(255,255,255,0.16)));
background: -webkit-linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
background: -o-linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
background: linear-gradient(top, rgba(255,255,255,0.82) 0%,rgba(255,255,255,0.16) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d1ffffff', endColorstr='#29ffffff',GradientType=0 );
-moz-box-shadow: 0 0 5px #595959; /* CSS3 box shadows */
-webkit-box-shadow: 0 0 5px #595959;
box-shadow: 0 0 5px #595959;
padding-top: 12px; /* large padding to get menu item to protrude upwards */
padding-bottom: 20px; /* large padding to get menu item to protrude downwards */
}

</style>
Dan untuk kode Menu nya yang anda paste dalam kode <body> adalah :

<ul class="semiopaquemenu">
<li><a href="http://codestyle.blogspot.com/">Home</a></li>
<li><a href="http://codestyle.blogspot.com/search/label/javascript" class="selected">Javascript</a></li>
<li><a href="http://codestyle.blogspot.com/search/label/css">Css</a></li>
<li><a href="http://codestyle.blogspot.com/search/label/php%5B">Php</a></li>
<li><a href="http://codestyle.blogspot.com/search/label/html">Html</a></li>
<li><a href="http://codestyle.blogspot.com/search/label/python">Python</a></li></ul><div class="bottombar"></div>
Jangan lupa ganti Url link yang ada dengan url tujuan kamu..

Contoh :


oke deh.. Semoga berguna buat kita semua

Membuat link tooltip pada posting

Kali ini kita akan membuat link tooltip dengan cara sederhana dengan menambahkan kode CSS ke dalam postingan.

Kegunaanya dapat beraneka ragam sesuai kebutuhan masing-masing. Jika ada yang ingin menambahkan maksud dari suatu kalimat, maka tooltip ini bisa membantu menjelaskan dengan tampilan yang lumayan keren.

Bagaimana hayo, kita mulai saja ya...

Untuk kode css nya :
<style>
/* Code Style CSS
by ycusoy
site (http://admin-belajar.blogspot.com) */
a.codestyle {position: relative;}
a.codestyle span {display: none;position: absolute;top: 20px;left: -10px;width: 300px;padding: 5px;z-index: 100;background: #000;color: #fff;font-size:11px;-moz-border-radius: 5px; /* this works only in camino/firefox */ -webkit-border-radius: 5px; /* this is just for Safari */}
a:hover.codestyle {font-size: 99%; /* this is just for IE */}
a:hover.codestyle span {display: block;}
</style>

Nah singkat bukan code css-nya..

Sekarang kita lanjut dengan bagaimana menempatkan tooltip tersebut pada beberapa kata atau kalimat dalam postingan..

kode :
<a href="#" class="codestyle">KALIMAT<span>DI SINI ISI TOOLTIP KAMU</span></a>

* KALIMAT ganti dengan Kalimat yang akan kamu buatkan tooltipnya
* DI SINI ISI TOOLTIP KAMU ganti dengan isi tooltip kamu

Contoh Kalimat :

Kali ini kita akan membuat link tooltipKegunaanya dapat beraneka ragam sesuai kebutuhan masing-masing. Jika ada yang ingin menambahkan maksud dari suatu kalimat, maka tooltip ini bisa membantu menjelaskan dengan tampilan yang lumayan keren. dengan cara sederhana dengan menambahkan kode CSS ke dalam postingan.

Bagaimana?? Mudah bukan...

This Template - a Admin theme from yanto Cusoy. Converted by Bisnis Indonesia Baru.