SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: <strong> <em>

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <strong> <em>

    I'm trying to make some bold and italic text.
    When I use <strong> <em> it effects all the text even though I'm using <strong/>
    at the end of the text it still effect text further down the page?
    How do I then isolate?
    Thanks

  2. #2
    Mouse catcher silver trophy
    SitePoint Award Recipient Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,088
    Mentioned
    65 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Barry360 View Post
    I'm trying to make some bold and italic text.
    When I use <strong> <em> it effects all the text even though I'm using <strong/>
    at the end of the text it still effect text further down the page?
    You'll kick yourself...

    The closing tag is </strong>, with the slash before the element name. That's the case for any non-empty element. It's only elements that can't contain any content that you put the slash at the end to make it self-closing (for example, <hr/> is equivalent to <hr></hr>).
    Any posts I write in Arial are on my mobile phone, so please excuse typos etc.
    Any posts I write in Verdana are on a PC, so feel free to berate me mercilessly for any mistakes


  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks

    Quote Originally Posted by Stevie D View Post
    You'll kick yourself...

    The closing tag is </strong>, with the slash before the element name. That's the case for any non-empty element. It's only elements that can't contain any content that you put the slash at the end to make it self-closing (for example, <hr/> is equivalent to <hr></hr>).
    Thanks Stevie D, so I close it like <strong/>

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    15,808
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Barry360 View Post
    Thanks Stevie D, so I close it like <strong/>
    No

    Code:
    <strong>   </strong>
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    No

    Code:
    <strong>   </strong>
    Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •