How do i make my text in a box?

Discussion in 'HTML & Website Design' started by BURR, Mar 4, 2010.

  1. #1
    im new to html and i need help!

    ok what i am trying to do i make my text with a color box behind it !


    I NEED THE HTML CODE ;)
     

    Attached Files:

    BURR, Mar 4, 2010 IP
  2. canadianguy_001

    canadianguy_001 Peon

    Messages:
    97
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <style type="text/css">
    .redbox { background-color:red; padding:150px; font-size:23px;}
    </style>
    <div class="redbox">MY TEXT</div>

    If youre actually trying to learn html though, you should probably just start off by reading some online tutorials and testing things yourself rather than getting other people to write it for you.
     
    canadianguy_001, Mar 4, 2010 IP
  3. typingmums

    typingmums Well-Known Member

    Messages:
    1,446
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    140
    #3
    As above - but I would always recommend using an external style sheet rather than embedded. This would mean rather than having this in the head:

    <style type="text/css">
    .redbox { background-color:red; padding:150px; font-size:23px;}
    </style>


    You would have the below code, which links to the external style sheet

    <link rel="stylesheet" type="text/css" href="style.css" />

    You then create a style sheet file called style.css (within the root menu), and within that style sheet you would list all of your css:

    .redbox {
    background-color:red;
    padding:150px;
    font-size:23px;
    }
     
    typingmums, Mar 4, 2010 IP