css paragraph help

Discussion in 'CSS' started by fadetoblack22, Nov 14, 2008.

  1. #1
    I have a class:

    .containter

    with 2 boxes .box & .box2:


    <div class=containter>
    <div class=box>
    <p>


    I need to make the p display inline, but I need to put it in the container class because there are other div elements inside it that need the inline <p>.

    So I need the p of .box when it is inside .container to display inline and not display inline if .box2 is inside .container

    Is that possible?

    I can't put the display inline in the .box because there are other p div elements.

    So something like .container box p

    I hope that makes sense.

    thanks.
     
    fadetoblack22, Nov 14, 2008 IP
  2. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .container p {
    display: inline;
    }

    .container .box p, .container .box2 p {
    display: block; (the default for p's)
    }

    Does that make sense?

    <div class="container"> (yesh, use quotes for values)
    <p>this p is inline</p>
    <p>inline peeeeee</p>
    <div class="box">
    <p>block</p>
    stuff
    </div>
    <p>peeee is inline!</p>
    <div class="box2">
    <p>blockitty blockitty</p>
    </div>
    <p>inline</p>
    </div>

    etc.
     
    Stomme poes, Nov 14, 2008 IP
  3. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #3
    yes, thanks. that helps :)
     
    fadetoblack22, Nov 14, 2008 IP