Go Back   DN Lodge Webmaster Forums > Web Design and Development > Web Design Discussion


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-26-05, 08:51 PM
WebForGod's Avatar
DNL Member
 
Join Date: May 2005
Location: Indiana, USA
Posts: 21
DNL Trust: (0)
Send a message via AIM to WebForGod Send a message via Yahoo to WebForGod
WebForGod is a pretty decent person
Default Positioning with CSS-P

POSITION
... style="position: absolute|relative; top:###px; left:###px;"

Absolute and relative positioning are the main methods used to place elements on your webpage. You can specify either, both, or none of these attribute/value sets. In absolute positioning, the position is determined without regard to the other parts of the page. Here's an example:

Code:
<div style="position:absolute; top:100px; left:100px;">Content 100 pixels from the page's left and top edges</div>
Not too tough: The number after "top" is the number of pixels (px) away from the top of the window. "Left" is the distance from the left side. You can also use a percent (e.g., left:50%) instead of a specific number.

You'll use relative positioning when you want to have the distance measured from wherever the webpage flow was last. For instance, if you had a graphic added in a SPAN tag with the style="position:relative; ..." after the above content, then it would appear below and right of the text.


VISIBILITY
... style="visibility: hidden|visible|inherit;"

This attribute is used to make an element appear or disappear, as one would expect. A hidden element still takes up the space on the page even though it can't be seen. When you use "inherit", the element becomes visible or hidden based on its parent element -- a picture inside of a DIV tag, for instance.

This is handy because you can use JavaScript and other languages to dynamically make parts of the page appear or disappear, like if you want to make helpful descriptions pop up when the user's pointer goes over a certain word.


Z-INDEX
... style="z-index:[-]###;"

Finally, there's the Z-index. This is used when you want to layer parts of the webpage, one on top of each other. Say you want to make a red box with a shadow for a menu item. Here's the code:

Code:
<DIV style="position:absolute; top:100px; left:100px; width:70px; height:20px; background:red; z-index: 5"><CENTER>HOME</CENTER></DIV>

<DIV style="position:absolute; top:105px; left:105px; width:70px; height:20px; background:black; z-index:-10"> </DIV>
The Z-index can be any number, positive or negative, including zero. The layers will appear on the page from the biggest negative number up to the biggest positive.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Want to remove these ads? Register for your free account here.

  #2  
Old 05-26-05, 09:25 PM
Joseph's Avatar
WD Owner
 
Join Date: Apr 2005
Location: Seattle Area
Posts: 645
DNL Trust: (0)
Send a message via MSN to Joseph
Joseph is a pretty decent person
Default

Thanks Adam, looks good
__________________

http://dncertification.com/images/admin
-Joseph C
WebmastersDatabase.com Owner -
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
cssp, positioning


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Images with CSS UndergroundMark Web Development Discussion 0 11-25-05 12:06 PM
CSS Introduction UndergroundMark Web Development Discussion 0 11-25-05 12:04 PM
CSS revolution jream Programming 7 10-05-05 09:58 AM
To CSS or not to CSS that is the question mikedavis Web Development Discussion 5 10-05-05 09:27 AM
CSS Tutorial! Joseph Web Design Discussion 1 05-25-05 01:58 PM


All times are GMT -5. The time now is 12:51 AM.



Copyright © 2005-2009 DNLodge.com.
vBulletin, © 2000-2009, Jelsoft Enterprises Limited.
SEO by vBSEO.
Advertising |  About Us |  Contact Us |  RSS |  Privacy Policy |  Back to Top