Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Location
    Northbrook, IL
    Posts
    394
    Thanks
    8
    Thanked 6 Times in 6 Posts

    Question CSS: first-of-type....but not.

    solved
    Last edited by Leeoniya; 12-30-2007 at 10:31 PM.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Leeoniya View Post
    solved
    this don't help anybody who try to find a solution to the same problem.

    best regards

  • #3
    Regular Coder
    Join Date
    Apr 2006
    Location
    Northbrook, IL
    Posts
    394
    Thanks
    8
    Thanked 6 Times in 6 Posts
    i wanted to find a way to remove the top margin from the first child and the bottom margin from the last child, but only if they were <p> elements.

    i realized that :first-child and :last-child already do type checks alongside the pseudo check:

    div.dlg_contents > p:first-child {margin-top: 0;}
    div.dlg_contents > p:last-child {margin-bottom: 0;}
    Last edited by Leeoniya; 12-30-2007 at 11:52 PM.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,666
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    Quote Originally Posted by Leeoniya View Post
    i realized that :first-child and :last-child already do type checks alongside the pseudo check
    Not in all browsers, though, and if at all then buggy in some.

  • #5
    Regular Coder
    Join Date
    Apr 2006
    Location
    Northbrook, IL
    Posts
    394
    Thanks
    8
    Thanked 6 Times in 6 Posts
    This is for an internal webapp where i have control over the browser choice of the enduser.

    <!--BEGIN RANT
    IE ruins "public domain" web development for me. ie7 does a lot to make it better, and i have high hopes for php support in Expression Web Designer 2.0, i think it does a great job with usability, and its rendering engine is the best i've seen yet.

    that aside, i only code internal webapps these days, for web standards - not hacks and workarounds, and test with standards compliant browsers. (Firefox 3b3 and Opera 9.50b1) I have no intention of going into public web development until the now-Acid2-complaint IE8 has been fully adopted by all IE users, which will probably be another 10 years. I demand 95&#37; implementation uniformity in Javascript/AJAX, CSS/XHTML, DOM. My time is better utilized NOT maintaining 2 codebases - something that Microsoft has made a necessity until recently, when alternatives have been freely and readily available.
    END RANT-->

    Leon


  •  

    Posting Permissions

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