Simple XHTML code error, please help.

Discussion in 'HTML & Website Design' started by jimcass, Oct 22, 2008.

  1. #1
    When something is coded in XHTML... My site looks normal when viewed using firefox but in IE it looks off... It's just when I am trying to include an image that can be clicked to enlarge to a bigger image. Does anyone know how I can change this code so it works?

    Here is the current code:
        <div class="box">
        <h2>Oct. 14th, 2008 ~ Terrible Towel</h2>
        <p><a target="_blank" href="images/toweltrade.jpg"><img src="images/toweltrademini.jpg" alt="Click the image to enlarge"/></a>So here we are, this is trade #1...I am hoping to turn my official Myron Cope Terrible Towel into a nice new piece of Steelers memorabilia.  This exact towel was purchased in 2005 at a GetGo on my way to Cleveland to see the Steelers beat the Browns!  I had forgotten my
        1995 Terrible Towel at home and you simply can't enter a game without your Steel Power!  After that win, the Super Bowl win and to this day it has been by my side for each game.  Now, it's piece #1 in my quest to trade with fellow Steelers fans!  Make me an offer!</p>
    
      </div></p>
    
      </div>
    Code (markup):
    and here are the results:
    [​IMG]
     
    jimcass, Oct 22, 2008 IP
  2. Daniel591992

    Daniel591992 Well-Known Member

    Messages:
    594
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    125
    #2
    Change:
    to this:

    and let me know how it works.
     
    Daniel591992, Oct 22, 2008 IP
  3. jimcass

    jimcass Well-Known Member

    Messages:
    221
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #3
    same result...

    I think it may have something to do with the </a>
     
    jimcass, Oct 22, 2008 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    Yup, float the <a>.

    cheers,

    gary
     
    kk5st, Oct 23, 2008 IP
  5. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #5
    and make a <br style="clear:both;" /> under the text, because sometimes is screws up the layout when you float ;) You always have to clear your floats.

    *edit*

    Hey.. Your A (and image) should also be defined AFTER the text and outside the paragraph

    Like this:
    Another thing... It looks like you're having a div, header and p INSIDE a p. Take a look at this:
    Should be deleted.
     
    elias_sorensen, Oct 23, 2008 IP