XHTML and &nbsp doesnt work?

10,774

Some XHTML configurations don't seem to have the full list of entity names. Use the numerical character reference,  

Edit: "Some XHTML configurations" means XHTML documents without a full XHML DOCTYPE declaration. If you omit the DOCTYPE altogether, or use a shorthand one, like <!DOCTYPE html>, the browser will only recognise the five XML entity names. So either provide a full DOCTYPE, like <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> or use numerical character references as above.

Share:
10,774

Related videos on Youtube

MultiWizard
Author by

MultiWizard

Updated on September 14, 2022

Comments

  • MultiWizard
    MultiWizard over 1 year

    Hi been out of web dev for a long time now, before when I wanted to put a space between two images i'd use &nbsp in HTML however XHTML is different? Been looking on the net but nothing is sinking in, could someone kindly help out?

    Here is my code;

    <img id ="aft" src="images/after_clamping.jpg" width="200" height="210" alt="" /><img   id ="tic" src="images/ticket.jpg" width="200" height="210" alt="" />
    
    • Brad
      Brad almost 11 years
      Don't use spaces for something like this. Do what @faino suggests and use CSS! Spaces are for separating words in text.
    • faino
      faino
      Did you include the semi-colon? &nbsp;
  • Rob
    Rob over 9 years
    I had this issue, once I defined the doctype as above it solved it. Thanks.!