This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Inline Elements


Learning Objectives

  • Describe 'inline' in the context of a hypertext document
  • Choose a public website and label several inline elements
  • Choose two of the inline HTML elements and describe a common usage for each
  • Demonstrate the proper usage of at least 3 different inline HTML elements

Task Material

HTML uses inline elements to mark data such as citations, computer code, images, and links. Inline elements cannot be placed directly in the <body> but should be nested within a block element, such as <p>.

We have already covered the anchor tag <a>, which is one of the inline elements, in a previous section. There are many other commonly used inline elements. Inline elements can be divided into two general types;

  • Phrase elements that act to mark a word or phrase
  • Presentation elements that affect the display of the element

Although there are presentation markup elements, it is advisable to use CSS for presentation and rely on HTML specifically for semantic markup.

Phrase Elements

<em> and <strong>

Stress emphasis <em> and importance<strong> are used to indicate emphasis. Stress emphasis is recommended as a marker for text that would be stated with linguistic emphasis (such as rate of speech or intonation). Use <strong> for text with strong importance, where a speaker might not alter their voice.

<p>Beans are <em>really</em> good for you. They are great for your <strong>heart and soul</strong>.</p>

<cite>

Often it is necessary to cite <cite> the source of a statement or idea. Sources for the <cite> tag are usually literary such as a book, play, website, newspaper, article, etc.

<p>I'm 17 years old. I'm not a straight-A
student or anything. Even so, I figured
out how to make an Internet that they
can't wiretap. I figured out how to jam
their person-tracking technology. I can
turn innocent people into suspects and
turn guilty people into innocents in
their eyes. I could get metal onto an
airplane or beat a no-fly list. I
figured this stuff out by looking at
the web and by thinking about it. If I
can do it, terrorists can do it. They
told us they took away our freedom to
make us safe. Do you feel safe? 
<cite>Little Brother by Cory Doctorow</cite></p>

<q>

Inline quotations can be marked with the <q> tag. These quotations generally involve people rather than literary works.

<p>Tim Berners-Lee said <q>What's very important from my point of view is that there is one web … Anyone that tries to chop it into two will find that their piece looks very boring.</q></p>

<dfn>

Sometimes we need to offer a definition for a term. The <dfn> tag is used for this purpose.

<address>

We use the <address> tags when displaying a physical address such as a mailing address.

<address>
123 Main Street<br/>
Anytown<br/>
</address>

<del>

The <del> tag  is used to show that text is no longer relevant in a document without actually removing the text. This is typically accomplished via a "strike through" line drawn across the text.

<p>Cats are great pets. Cats eat <del>vegetables</del> small animals.</p>

Further Reading

There are several more inline HTML elements. The following sites offer further details:

Task

  1. Create a document at HTMLpad using the elements introduced in this task.
  2. Use additional markup from previous tasks as desired and/or necessary.
  3. Post the link to your creation on this forum for review and credit :-)

Task Discussion


  • Juan Pablo Zafra   Jan. 15, 2013, 8:10 a.m.
  • EcologicalHumanist   Dec. 13, 2012, 2:23 p.m.

    Here is my attempt:

    http://htmlpad.org/Example/

  • ameera0303   Oct. 22, 2012, 2:53 p.m.
  • Christos Tsagkournis   Oct. 12, 2012, 11:26 p.m.

    http://htmlpad.org/WorkingHTML/

    The <address> tag is not an inline element, it is a block element

  • Christos Tsagkournis   Oct. 12, 2012, 11:23 p.m.
  • Rick E   Oct. 11, 2012, 9:41 p.m.
  • Joris Pekel   Oct. 10, 2012, 5:14 a.m.
  • RachelRaccuia   Oct. 6, 2012, 9:56 a.m.

    Ugh, embarrassing. Mine.

     

    https://thimble.webmaker.org/p/1e1

  • Sonic   Oct. 5, 2012, 12:40 a.m.
  • marcmars   Oct. 2, 2012, 1:33 a.m.

    This is same page now more content http://htmlpad.org/myfirstwebpage/

  • Hary Mitchell   Sept. 30, 2012, 4:33 p.m.
  • Garrison Snelling   Sept. 19, 2012, 11:02 a.m.

    http://htmlpad.org/world-of-webcraft/


    PIRATES ARE VERY DANGEROUS.
    Robert Garrison Snelling IV

  • mkII_gti_vr6T   Sept. 11, 2012, 11:31 p.m.
    Ordered and unorded list

    hello, i'm nathan simmons
    Lead programmer of FCG

    FCG is Located at
    123 north east st
    here,PA

  • Joanne   Aug. 25, 2012, 4:59 p.m.
  • seefoosam   Aug. 24, 2012, 7:11 p.m.

    Hi everybody.

    Here is mine.

    This is a great learning tool. I am having a great time!

  • shuniata   Aug. 23, 2012, 10:25 a.m.
  • Danedeer   Aug. 15, 2012, 10:33 a.m.

    http://htmlpad.org/danedeerinline/

    I can't fathom the address tag. If you use it, it doesn't do anything. The lines are created by the <br/> Please can someone explain what the address tag does?

    Cheers

  • al read   Aug. 15, 2012, 10:36 a.m.
    In Reply To:   Danedeer   Aug. 15, 2012, 10:33 a.m.
    Thanks for your message. I will be out of the office on annual leave until Monday 20th August If your enquiry is urgent, please SMS me on my mobile. Kind regards, Alan Read Head of Learning Technologies Learning Technologies Group Pearson UK +44 (0) 7703 750913 This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723
  • saravanan   Aug. 15, 2012, 10:50 p.m.
    In Reply To:   Danedeer   Aug. 15, 2012, 10:33 a.m.

    Dandeer take a look at this http://html5doctor.com/the-address-element/ they have explained the correct way.

    The address element represents the contact information for its nearest article or body element ancestor. If that is the body element, then the contact information applies to the document as a whole.

    The p element is the appropriate element for marking up postal addresses in general.

      I learned the actual only because of your doubt. Thank you.

  • al read   Aug. 15, 2012, 10:53 p.m.
    In Reply To:   saravanan   Aug. 15, 2012, 10:50 p.m.
    Thanks for your message. I will be out of the office on annual leave until Monday 20th August If your enquiry is urgent, please SMS me on my mobile. Kind regards, Alan Read Head of Learning Technologies Learning Technologies Group Pearson UK +44 (0) 7703 750913 This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723
  • Paolo Vagnini   Aug. 16, 2012, 5:27 a.m.
    In Reply To:   saravanan   Aug. 15, 2012, 10:50 p.m.

    Me too: i didn't use it the correct way before! Thank you guys!

  • al read   Aug. 16, 2012, 5:30 a.m.
    In Reply To:   Paolo Vagnini   Aug. 16, 2012, 5:27 a.m.
    Thanks for your message. I will be out of the office on annual leave until Monday 20th August If your enquiry is urgent, please SMS me on my mobile. Kind regards, Alan Read Head of Learning Technologies Learning Technologies Group Pearson UK +44 (0) 7703 750913 This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723
  • Danedeer   Aug. 16, 2012, 9:15 a.m.
    In Reply To:   saravanan   Aug. 15, 2012, 10:50 p.m.

    Thankyou for your helpful reply. You must be a kinaesthetic learner like me... I can only learn when I either do something myself or explain it to someone else; often explaining something to myself that I hadn't realised I didn't know until then. oops. If you follow me.

    I see. (I think I see) The address tag is only used for addresses which apply to the content on the page; to a whole page, or website, or just to a section of the page. It wouldn't be appropriate to use the address tag for, say, an address which has paid to be there to advertise itself but does not relate particularly to the content of the page it's on. Got that bit at any rate. Cheers.

    so... having discovered when it's appropriate to use the address tag, I STILL don't see what it does. I mean, if it's an email address, you can just make it clickable... a postal address can be copied and pasted; ot maybe scripted to make an address label...

    Is it some sort of safeguard against address-searching  bots?

    I'm really puzzled. Sorry for being so persistantly thick.

  • al read   Aug. 16, 2012, 9:17 a.m.
    In Reply To:   Danedeer   Aug. 16, 2012, 9:15 a.m.
    Thanks for your message. I will be out of the office on annual leave until Monday 20th August If your enquiry is urgent, please SMS me on my mobile. Kind regards, Alan Read Head of Learning Technologies Learning Technologies Group Pearson UK +44 (0) 7703 750913 This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723
  • saravanan   Aug. 16, 2012, 11:06 a.m.
    In Reply To:   Danedeer   Aug. 16, 2012, 9:15 a.m.

    http://www.w3.org/TR/html401/struct/global.html#edef-ADDRESS

    The ADDRESS element may be used by authors to supply contact information for a document or a major part of a document such as a form. This element often appears at the beginning or end of a document.

    http://www.w3.org/TR/html401/index/elements.html

    Actual ADDRESS description is information on author. May be we can use it provide contact information.

    I think Bots nothing to do with this. If they want to safeguard address from bots they use captcha or other techniques.

    See <em>, <cite>, even <address> tag altogether have the same italic style .

    we can use <i> instead of these, but they may have created these tags based on the concept " web - made of contents by  authors and content is king". So these tags may be created for author credentials.

    ----------------------------------------------------------------------------------------

    The more thick you are, the more stronger you will be.

  • al read   Aug. 16, 2012, 11:08 a.m.
    In Reply To:   saravanan   Aug. 16, 2012, 11:06 a.m.
    Thanks for your message. I will be out of the office on annual leave until Monday 20th August If your enquiry is urgent, please SMS me on my mobile. Kind regards, Alan Read Head of Learning Technologies Learning Technologies Group Pearson UK +44 (0) 7703 750913 This email was sent by a company owned by Pearson plc, registered office at 80 Strand, London WC2R 0RL. Registered in England and Wales with company number 53723