Web Analytics Made Easy -
StatCounter New CSS standard (if it doesn't exist already) - CodingForum

Announcement

Collapse
No announcement yet.

New CSS standard (if it doesn't exist already)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New CSS standard (if it doesn't exist already)

    All right, working with CSS positioning in a pain, and I hereby propose the following adjustment to the "position" element of CSS.

    Create
    position:anchor;
    and
    anchor-point: [x=position, y-position]

    Here's the concept,


    You create a div, or other block level element

    In the body or other element you define an acnhor-point as follows in your css.

    body {
    anchor-point: 50, 10;//this value could be pixels, %, and em.

    }

    This would create an anchor point 50 pixels from the left an 10 pixels from the top.

    Now if you want to position another block level element say 100 pixels down and 30 pixels right, (I'll use a div with a class of div 1 in my example) you'd do this...
    .div1 {
    position:anchor;
    top: 100;//this value could be pixels, %, and em.
    left:30;//this value could be pixels, %, and em.
    }

    Of course you ask, what happes if you define multiple acnhors, 1 in the body and another in a table or div? Well, my solution would be that the anchor points are inherited from the closest parent element.

    Just my 2-bits on the subject. If something like this exists please let me know. I find the "relative" about as easy to get along with as my own relatives.
    Create accessible online surveys -::- Koobten.com - compare netbook prices and reviews -::- Affordable, reliable hosting for less than $20 per year
    Zend Certified Engineer


  • #2
    Re: New CSS standard (if it doesn't exist already)

    Originally posted by bcarl314
    1. New CSS standard

    2. I find the "relative" about as easy to get along with as my own relatives.
    bca...
    1. just a whews® n' sooo glad /me didnt bother to just a learn/memorize/use® the ol' ones...lol...

    2. just a rotflmao® n' ^5s...hehehe...
    The New JustaBuster Version 2.0 OR JustaBusta Lite V2.0
    ...just a special® thanx kinda hugs to jkd n' nex ...:O)))

    CommemorateWTC.com --Please lend your support

    Comment


    • #3
      I don't see what your "anchor" idea does that:

      position: absolute;
      left: bla;
      top: bla;
      right: bla;
      bottom: bla;


      can't do? Or maybe I didn't understand what you said...
      jasonkarldavis.com

      Comment


      • #4
        Good idea !

        It's not just a positioning thing he's on about I don't think.
        More of a reference point on the page that other DIVs can be placed relative to... sort of like changing the left & top margin for a DIV tag.

        Peace \/
        `Sp00kY`

        Comment


        • #5
          spOOky, exactly right. absolute positioning is an implementation of this with the reference (anchor-point) of 0,0. And you are allowed only one reference point. What I am proposing is multiple anchor points within a document.

          That way you could easily center a document by saying
          body {
          anchor-point:50%,10;
          }
          then align all your divs from that anchor point. Saves time in coding by % and I would imagine it should be easier to implement for the borwser.
          Create accessible online surveys -::- Koobten.com - compare netbook prices and reviews -::- Affordable, reliable hosting for less than $20 per year
          Zend Certified Engineer

          Comment


          • #6
            .anchor {
            position: absolute;
            left: 30px;
            top: 20px;
            }

            .offsetted {
            position: relative;
            left: 40px;
            top: 20px;
            }

            ........

            <div class="anchor">
            <div class="offsetter">
            bla
            </div>
            </div>

            No?
            jasonkarldavis.com

            Comment

            Working...
            X