treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Text tagged "p" and "li"

  • Hi again.. new issue.. I hope it will be simple to correct this time..


    This is the fact: I have a simple html text tagged <p> but in the middle of this text I have an <li> ok?
    After this <li> I need to go on with the normal html text but this second part of the text goes sooo down to the page... don't know why, I'm gonna paste the code:


    #div_name p{

    font-family: Arial,\"Times New Roman\",Times,serif;
    font-weight: normal;
    font-size: 0.900em;
    color: white;
    text-align: left;
    margin-top: 20%;
    padding-left: 25%;

    }


    #div_name li{

    font-family: Arial,\"Times New Roman\",Times,serif;
    font-weight: normal;
    font-size: 0.900em;
    color: white;
    text-align: left;
    margin-left: 220px;
    padding-right: 30px;


    }

    #div_name span{
    color: #9cd5f0;
    }

    span#sec_par{
    color: #9cd5f0;
    margin-left: 180px;


    }








    <div id=\"DIV_NAME\"><p>
    TEXT<span>TEXT</span>TEXT<br /></p>

    <span id=\"sec_par\">little text<br/><br/></span>

    <li>---</li>
    <li>---</li>
    <li>---</li>
    <li>---</li>

    <p>TEXT</p></div>


    Thanks!!
  • Remember to wrap your list items (li) in either an ordered list (ol, numbers) or an unordered list (ul, bullets). So:


    <ul>
    <li>Item1</li>
    <li>item2</li>
    <li>etc...</li>
    </ul>
  • Hi TheDoc thx but the problem is that the second part of the text, after the <ul> etc... goes down the page.. as it has got a big margin on it... just wondering why... this second part goes over the image.. over the div...
  • This is why:

    #div_name p {
    margin-top: 20%;
    }
  • I need to give an id to the sec <p> .. ow ca I do it? I know this is the basic of css...

    Because if I delete that { margin-top: 20$ } all the text rises up, but if I try to put it down again then the sec part of the text, also tagged <p> after the <ul> <li> go down too but for its own... adding a margin more.. do you know what I mean..

    --- I need to move the text as a unique block of text.. that's it..
  • Instead of add margin to the <p>, you should add padding-top to the div.
  • Why are you using the li tag, just use span id="something" and then in your CSS file, add:

    .something {
    styleing here
    }

    The li tag is for lists.