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”:

Example

body { margin-left:200px; background:#5d9ab2 url(‘http://www.w3schools.com/css/img_tree.png’) no-repeat top left; } .container { text-align:center; } .center_div { border:1px solid gray; margin-left:auto; margin-right:auto; width:90%; background-color:#d0f0f6; text-align:left; padding:8px; }

Hello World!

This example contains some advanced CSS methods you may not have learned yet. But, we will explain these methods in a later chapter in the tutorial.

function resizeHeight(elmnt) { if (window) { var x=window.innerHeight if (x) { var y=(x-205); if (y>400) { document.getElementById(“pre_code”).style.height=y + “px”; document.getElementById(“viewIFRAME”).style.height=y + “px”; } } } } resizeHeight() window.onresize=function(){resizeHeight()}

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s