DHTML
  Home arrow DHTML arrow Page 5 - Layouts, Margins, and Other Style Sheet Pr...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DHTML

Layouts, Margins, and Other Style Sheet Property References
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-10-04

    Table of Contents:
  • Layouts, Margins, and Other Style Sheet Property References
  • Layout-grid-line
  • Line-break
  • List-style-image
  • Margin

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Layouts, Margins, and Other Style Sheet Property References - Margin


    (Page 5 of 5 )

    margin
    IE 4 NN 4 Moz all Saf all Op all CSS 1

    Inherited: No

    This is a shortcut property that can set the margin widths of up to four edges of an element with one statement. A margin is space that extends beyond the border of an element to provide extra empty space between adjacent or nested elements, especially those that have border properties set. You may supply one to four space-delimited margin values. The number of values determines which sides receive the assigned margins.

    CSS Syntax

    margin: marginThickness | auto {1,4}

    Value

    This property accepts one, two, three, or four values, depending on how many and which margins you want to set. Values for marginThickness  can be lengths , percentages of the next outermost element size, or the auto constant. Value quantities and positions are
    interpreted as follows.

    Number of values Effect
    1 All four margin edges set to value
    2 Top and bottom margins set to the first value, right and left margins set to the second value
    3 Top margin set to first value, right and left margins set to second value, bottom margin set to third value.
    4 Top, right, bottom, and left margin set, respectively

    Initial Value          0

    Example       p.highlight {margin: 10px 20px}

    margin-bottom, margin-left, margin-right, margin top

    Applies To             All elements.

    Object Model Reference

    [window.]document.getElementById("elementID").style.margin

    margin-bottom, margin-left, margin-right, margin-top IE 4 NN 4 Moz all Saf all Op all CSS 1

    Inherited: No

    All four properties set the width of a single margin edge of an element. A margin is space that extends beyond the element’s border and is not calculated as part of the element’s width or height.

    CSS Syntax

    margin-bottom: marginThickness | auto margin-left: marginThickness | auto
    margin-right: marginThickness | auto
    margin-top: marginThickness | auto

    Value

    Values for marginThickness  can be lengths , percentages of the next outermost element size, or the auto constant.

    Initial Value        0

    Example

    blockquote {margin-left: 20; margin-top: 10} #narrowCol {margin-left: 30%; margin-right: 30%}

    Applies To                    All elements.

    Object Model Reference

    [window.]document.getElementById("elementID").style.marginBottom
    [window.]document.getElementById("elementID").style.marginLeft
    [window.]document.getElementById("elementID").style.marginRight
    [window.]document.getElementById("elementID").style.marginTop

    marker-offset
    IE n/a NN n/a Moz n/a Saf n/a Op n/a CSS <2.1

    Inherited: No

    Controls the space between list item markers (which occupy their own box in the CSS box model) and the box that contains the list item text. Requires that the list item elements be set to a display style marker .

    CSS Syntax

    marker-offset: length | auto

     

    Value

     

    A length value (see the discussion of length values at the beginning of this chapter), or the auto constant.

    Initial Value          auto

    Example        li:before {display: marker; marker-offset: 4em}

    Applies To

    List elements set to marker display mode (generally with a :before or :after pseudo-class).

    Please check back next week for the continuation of this article.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "Dynamic HTML: The Definitive Reference,...
     

    Buy this book now. This article is excerpted from chapter four of Dynamic HTML: The Definitive Reference, Third Edition, written by Danny Goodman (O'Reilly; ISBN: 0596527403). Check it out today at your favorite bookstore. Buy this book now.

    DHTML ARTICLES

    - Text-Justify, Volume, and Other Style Sheet ...
    - Ruby-Position, Size, and Other Style Sheet P...
    - Padding, Pages, and More Style Sheet Propert...
    - Marks, Orphans, and More Style Sheet Propert...
    - Layouts, Margins, and Other Style Sheet Prop...
    - Floats, Fonts, and Other Style Sheet Propert...
    - Color, Filters, and Other Style Sheet Proper...
    - Borders and More with Style Sheets
    - Learning Style Sheet Properties
    - Style Sheet Property Reference
    - Completing a Noisy Image Application
    - An Object-Based Approach to Building Noisy I...
    - A Basic Method for Building Noisy Images
    - Adding More Features to Sliders with the Scr...
    - Using Sliders with the Scriptaculous Framewo...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway