TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-14-2008, 03:14 AM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 254
Thanks: 39
sarmenhb is on a distinguished road
Default 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 :)
__________________
http://www.sarmenhb.com
Send a message via AIM to sarmenhb Send a message via MSN to sarmenhb Send a message via Yahoo to sarmenhb Send a message via Skype™ to sarmenhb
sarmenhb is offline  
Reply With Quote
Old 08-14-2008, 04:00 AM   #2 (permalink)
The Acquainted
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 175
Thanks: 6
CoryMathews is on a distinguished road
Default

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.
CoryMathews is offline  
Reply With Quote
Old 08-14-2008, 04:20 AM   #3 (permalink)
The Addict
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 247
Thanks: 6
Kalle is on a distinguished road
Default

Try take a look at the MSDN page, it has all of background's arguments:
background Property (A, ADDRESS, B, ...)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is online now  
Reply With Quote
Old 08-14-2008, 04:43 AM   #4 (permalink)
The Visitor
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
enzochi@gmail.com is on a distinguished road
Default 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
enzochi@gmail.com is offline  
Reply With Quote
Old 08-14-2008, 03:00 PM   #5 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 254
Thanks: 39
sarmenhb is on a distinguished road
Default

thank you all for your replys this Efficient CSS with shorthand properties | 456 Berea Street is a great website!
__________________
http://www.sarmenhb.com
Send a message via AIM to sarmenhb Send a message via MSN to sarmenhb Send a message via Yahoo to sarmenhb Send a message via Skype™ to sarmenhb
sarmenhb is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:02 AM.

 
     

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