How do I align this icon with the text?

Discussion in 'HTML & Website Design' started by VolumeAds, Jun 11, 2009.

  1. #1
    *EDIT - I "can't post images yet"

    Can anyone help? How do I align a small icon with text? Code samples will help.
     
    VolumeAds, Jun 11, 2009 IP
  2. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #2
    I have no idea what you're trying to do... Maybe try:

    <div style="line-height:**px"><img src="image.jpg" style="float:left" />Text</div>

    Where **px is the height of your image.
     
    Kerosene, Jun 11, 2009 IP
  3. 1waylinkbuilding

    1waylinkbuilding Active Member

    Messages:
    183
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    The problem is that the alignment is on the element with a class of "x-btn-center". To solve it, add a style as shown below.

    In your CSS:

    .my-button-name .x-btn-center {
    text-align: left;
    }

    In your javascript:

    var button = new Ext.Button('my-button',{
    cls: "x-btn-text-icon my-button-name",
    text: "Press me!",
    })

    let me know if you any problem..?
     
    1waylinkbuilding, Jun 11, 2009 IP