SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: text position

  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question text position

    For this example instead of using <br> or <clear> or <figure> tag can I use any other tags or CSS elements?
    test.jpg

    <!DOCTYPE html>
    <html>
    <head>
    <title>my page</title>
    <style>
    img.one
    {
    float:right;
    width:400px;
    height:312px;

    }


    h1.two {text-align:right;}


    </style>
    </head>
    <body>
    <h1 class="two">this is some text.</h1>

    <img class="one" src="images/old.jpg" alt="">
    <br><br><br><br><br><br><br><br><br><br><br><br>
    <h1 class="two">this is some text.</h1>



    </body>
    </html>

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,176
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    There are various options, including clear: both on the h1s:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>my page</title>
    <style>
    img.one
    {
    float:right;
    width:400px;
    height:312px;
    margin-bottom: 30px;
    }
    
    h1.two {text-align:right; clear: both;}
    
    </style>
    </head>
    <body>
    <h1 class="two">this is some text.</h1>
    
    <img class="one" src="images/old.jpg" alt="">
    
    <h1 class="two">this is some text.</h1>
    
    </body>
    </html>

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    You asked this same question yesterday and it was answered in detail.

    Please do not post duplicate threads.

    Thread closed.


Bookmarks

Posting Permissions

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