Results 1 to 5 of 5

Thread: slide menu bar + indent

  1. #1
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default slide menu bar + indent

    hi. Someone has tampered with my site, and changed my formatting. I fixed all of it except one thing: how do I make it so all text inside the <p></p> tags is indented. I had the script, but now I can't remember it...
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  2. #2
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    never mind, got it:

    Code:
    <style type="text/css">
    p {margin-left: 0.5cm}
    </style>
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by IanMarlowe
    how do I make it so all text inside the <p></p> tags is indented.

    [...]

    <style type="text/css">
    p {margin-left: 0.5cm}
    </style>
    Whilst padding and margins may appear similar superficially, they are different: margins shift the border, padding, and content regions of an element, whilst padding alters only the content, separating it from where the border would appear. Also note that padding uses the background of the element, whereas margins are transparent and allow the content beneath to show through.

    Centimeters are not appropriate units unless you're producing a print style sheet (or a style sheet for some other fixed-dimension medium). A centimeter on one monitor may look fine, but disproportionate on another. As this is related to text, you should use a font-relative unit such as ex or em.

    Mike

  4. #4
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ex? em? It works fine with cm... are you suggesting that I use pixels?
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by IanMarlowe
    ex?
    The x-height of a font; literally the height of the letter x, though it generally means the height of any lowercase letter.

    em?
    I forget what this corresponds to. I think it's either the width of a lowercase m or the height of an uppercase M. In any case, in CSS an em is the same as the font-size property, so 1.5em at font-size: 12xx (whatever) is 18xx.

    It works fine with cm...
    For what values of 'fine'? Consider that with my monitor, I have the following equivalences for 1cm at various dimensions:

    • 640x480: 20px
    • 800x600: 25px
    • 1024x768: 32px
    • 1280x1024: 40px
    Your indent will get much larger whilst the font size doesn't change. Depending on your monitor size and resolution and the user's size and resolution, your 1cm could be just right, or horribly disproportionate.

    Absolute units (centimeters, inches, millimeters, points, and picas) are only useful when you know exactly how large a medium is (like a sheet of paper, for instance). It should be obvious that you can't possibly know this when it comes to monitors as they vary with each model and manufacturer.

    are you suggesting that I use pixels?
    No, otherwise I'd have said, "Use pixels." Find the equivalent size in ex or em units, and use that.

    Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •