Text aligned with image code?

Discussion in 'HTML & Website Design' started by master-yoda, Dec 29, 2012.

  1. #1
    Can someone help me out please with what is probably easy code.I want to put a paragraph next to an image but every time I try the text always starts at the bottom of the image. How do I get it to start at the top?Thank you.
     
    master-yoda, Dec 29, 2012 IP
  2. AlbCoder

    AlbCoder Well-Known Member

    Messages:
    126
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    163
    #2
    you need to learn css margin and padding for this
     
    AlbCoder, Dec 29, 2012 IP
  3. AlbCoder

    AlbCoder Well-Known Member

    Messages:
    126
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    163
    #3
    Lets see a mini tuto.

    <div id="image>
    <div id="text"> test ttest test test test test test test.. </div>
    </div>

    #image {
    float:left;
    width:500px;
    height:345px;
    margin:5px 0px 0px 15px;
    background-image:url(yourimage.jpg);
    background-repeat:no-repeat;
    }
    #text {
    position:relative;
    width:400px;
    height:90px;
    left: 0px;
    float:left;
    top:220px;
    filter:alpha(opacity=50);
    -moz-opacity:.50;
    opacity:.50;
    background-color:#000;
    color:#fff;
    font-size:11px;
    line-height:16px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    padding:10px;
    }
     
    AlbCoder, Dec 29, 2012 IP
  4. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,200
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #4
    Add align=left to the image.
     
    dcristo, Dec 29, 2012 IP