A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: basic CSS, align text to top of div

  1. #1
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127

    basic CSS, align text to top of div

    How do I make the first paragraph of text in a div start against the top edge?

    thanks
    Mark

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Code:
    DIV>p:first-child {margin-top: 0}
    That won't work in Internet Explorer 6, if you need it to, you'll have to set up a class and apply the class to those paragraphs.

  3. #3
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    Thanks,
    can I set that up in my CSS for the Div?
    It does not seem to work there
    But does in the paragraph without first child?
    PHP Code:
    #month1Dates, #month2Dates{
            
    width271px;
            
    top0;
            
    floatleft;
            
    border1px solid #CEB1E4;
            
    padding0 5px 0 5px;
            
    text-align:left;
    can I put it here?
        }

    seems to work like this

    #month2Dates p{
            
    padding0 0 0 0;
            
    margin-top0;        
        } 
    Last edited by mgason; 05-13-2010 at 03:51 PM. Reason: extra info

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    No, you can't put it in #month1Dates or #month2Dates. You could do it as #month1Dates p, #month2Dates p, but that will apply to all paragraphs in that section, not just the first one.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center