smile face in HTML

Discussion in 'HTML & Website Design' started by alexei_aus, Jul 5, 2007.

  1. #1
    does anyone know how to stick in smiley face in html code as :) not just : )?
     
    alexei_aus, Jul 5, 2007 IP
  2. MrX

    MrX Well-Known Member

    Messages:
    1,563
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    140
    #2
    u mean insert a graphic?

    <img src="/myimagefolder/smile.gif" alt="smile" />
    HTML:
    html has no built-in smilie graphics if that's what you're asking. that's just a feature of this forum software (vbulletin).
     
    MrX, Jul 5, 2007 IP
  3. alexei_aus

    alexei_aus Active Member

    Messages:
    626
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #3
    well, i thought there might be some interesting trick to it. never know what those programmers are up to
     
    alexei_aus, Jul 5, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As it's been said before, you have to insert an image to do that. Most forum software packages have scripts that take ASCII text art (like smileys) and converts them to HTML code for images that then get displayed as smileys.
     
    Dan Schulz, Jul 5, 2007 IP
  5. ColorWP.com

    ColorWP.com Notable Member

    Messages:
    3,121
    Likes Received:
    100
    Best Answers:
    1
    Trophy Points:
    270
    #5
    Or you can use "Smiley Faces Font", but the smileys will be visible only to people that have the font installed. You can use CSS to add this font to your page and ask people at the top of your page to download your font. You may succeede
     
    ColorWP.com, Jul 6, 2007 IP
  6. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #6
    it's usually done when filling a website with dynamic data from within a database. then it's just a pattern match away from an image.

    example in in php.... assuming you have smile.gif :)

    
    <?php
        $str = "im going insert my smiley :) into this sentence. yay!!! :)";
        echo preg_replace("/:\)/","<img src=\"smile.gif\" alt=\"smile\" />",$str);
    ?>
    
    PHP:
     
    ansi, Jul 6, 2007 IP
  7. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Wingdings has 3 very basic smilie faces and is certainly installed as standard on all windows based PCs - dont have the default fonts list to hand to check Mac and dont even know if there is a default fonts list for Linux

    I suspect however you mean as has been as per the smilies here in which case you use a "replace" command in your chosen server side language/ framework
     
    AstarothSolutions, Jul 6, 2007 IP