TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   XHTML, HTML, CSS (http://www.talkphp.com/xhtml-html-css/)
-   -   help me understand short notation. (http://www.talkphp.com/xhtml-html-css/3239-help-me-understand-short-notation.html)

sarmenhb 08-14-2008 02:14 AM

help me understand short notation.
 
for example, this line of code

Code:

body {
background: #eee url(bg.gif) 0 100% repeat;
}

from my thinking the long notation would be

Code:

body {

background-color:#eeeeee;
background-image:url(bg.gif);
background-repeat:repeat;
}

but what is the 0 and 100% in long notation?

also the thing thats not making sense to me is
for example this template: [image]http://i2.sitepoint.com/graphics/image031.png[/image]

which can be found here: Breaking Out of the Box With CSS Layouts [CSS Tutorials]

the header image with the swirly whose id is called header.
the code that is holding it up there is written like this

Code:

background: #966 url(header.gif) bottom no-repeat;
then the footer swirly is written like this
Code:

background: #333 url(footer.gif) top no-repeat;
whats confusing the life out of me is that , see for the footer code how it has the keyword top in it and the header have bottom in it. how is bottom showing on top? read again if ur confused to what im saying :)

CoryMathews 08-14-2008 03:00 AM

I have no idea what the 0 and 100% do never seen it before, however the background:#333 url(footer.gif) top no-repeat; just means what it says add the background image dont repeat it and position it at the top of that div. then apply the dark grey every where the image is not at.

The reason the footer has top and the header has bottom is so that the layout stays together. You want the header right against the content so you place it on the bottom and you want the footer against the content so you place it at the top.

Kalle 08-14-2008 03:20 AM

Try take a look at the MSDN page, it has all of background's arguments:
background Property (A, ADDRESS, B, ...)

enzochi@gmail.com 08-14-2008 03:43 AM

Css
 
Hi there,

The short hand for the background like this:

body{
background: #ccc url(/img/pic.png) top left no-repeat;
}

the 100% is for the
bakground-position: 100%

it can also be specified in pixels (10px 200px)

this link does a better job explaining than i can..
Efficient CSS with shorthand properties | 456 Berea Street

hope this helps..
AK

sarmenhb 08-14-2008 02:00 PM

thank you all for your replys this Efficient CSS with shorthand properties | 456 Berea Street is a great website!


All times are GMT. The time now is 01:44 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0