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
    New Coder
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Need help with text positioning

    I'm trying to accomplish the following in CSS:


    but so far, I can only get it to look like this:



    can someone check out my code and tell me what i'm doing wrong?
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        
    <
    html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <
    head>
        <
    title></title>
    </
    head>

    <
    body>
    <
    style type="text/css">
    .
    pricepoint{
        
    float:left;
        
    font-familyArial;
        
    font-size30px;
        
    font-weight:700;
        
    text-align:center;
        
    color:#000;
        
    margin:0 auto
    }
    .
    smalldollar{
        
    floatleft;
        
    text-aligncenter;
        
    color:#000;
        
    font-size:20px;
        
    margin:0 auto
    }
    .
    smalldollarfrom{
        
    positionabsolute;
        
    color:#000;
        
    text-aligncenter;
        
    font-size:10px;
        
    margin18px 0 0 0;
        }
    .
    ppl{
        
    floatleft;
        
    text-align:center;
        
    color:#000;
        
    font-size:10px;
        
    margin0 auto;
    }
    .
    tripamount{
        
    floatleft;
        
    text-align:center;
        
    color:#000;
        
    font-size:30px;
    }
    .
    kindoftrip{
        
    floatleft;
        
    text-align:center;
        
    color:#000;
        
    font-size:10px;
    }
    .
    rightprice{
        
    floatleft;
        
    positionabsolute;
        
    text-align:center;
        
    color:#000;
        
    font-size:20px;
        
    margin0 0 0 26px;
    }

    </
    style>
    <
    div class="pricepoint">
        <
    div class="ppl">
            <
    class="smalldollar">&nbsp;&nbsp;$</p>
            <
    class="smalldollarfrom">from</p>
        </
    div>
        <
    div class="rightprice">
            <
    class="tripamount">299</p>
            <
    class="kindoftrip">RT</p>
        </
    div>

    </
    div>
    </
    body>
    </
    html

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    One variation
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title></title>
    <style type="text/css">
    .pricepoint {
    font-family: Arial;
    text-align:center;
    color:#000;
    font-size:10px;
    font-weight:normal;
    float:left;
    }
    
    .smalldollar {
    text-align: center;
    color:#000;
    font-size:20px;
    position:relative;
    top:-10px;
    left:-10px;
    }
    
    .tripamount {
    text-align:center;
    color:#000;
    font-size:30px;
    margin-left:-10px;
    }
    </style>
    </head>
    <body>
    <div class="pricepoint">from<span class="smalldollar">$</span><span class="tripamount">299</span><span>RT</span> </div>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts
    u are god. lol. thanks for the help, I really appreciate it. u got my nomination!

  • #4
    New Coder
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    2
    Thanked 0 Times in 0 Posts
    actually, is there an alternative to accomplishing this without the use of top and left? because I'm trying to make this show up in an email and gmail doesnt support top and left.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I don't see how this is going to work. Gmail encodes all of its html so the html is unusable. Maybe this will work for you. I don't know
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title></title>
    <style type="text/css">
    .pricepoint {
    font-family: Arial;
    text-align:center;
    color:#000;
    font-size:10px;
    font-weight:normal;
    float:left;
    position:relative;
    }
    
    .smalldollar {
    text-align: center;
    color:#000;
    font-size:20px;
    position:absolute;
    margin-top:-35px;
    margin-left:10px;
    display:block;
    _top:0;
    _left:0;
    }
    
    .tripamount {
    text-align:center;
    color:#000;
    font-size:30px;
    }
    </style>
    </head>
    <body>
    <div class="pricepoint">from<span class="smalldollar">$</span><span class="tripamount">299</span><span>RT</span> </div>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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