Swapna Kumar Panda ๎จ€ Profile picture
Mar 21 โ€ข 21 tweets โ€ข 3 min read
15 Useful HTML Elements for Text Contents

โ‡ฉ
๐Ÿ“‹ What shall we explore?

โžŠ abbr
โž‹ dfn
โžŒ em
โž strong
โžŽ mark
โž small
โž q
โž‘ blockquote
โž’ cite
โž“ var
โžŠโžŠ code
โžŠโž‹ kbd
โžŠโžŒ samp
โžŠโž data
โžŠโžŽ time
๐Ÿ’ญ Why is this Thread?

โ‘ In a typical web page, we render varieties of text contents. The context of few contents may vary from others.

โ’ Sometimes we may have to highlight them semantically for SEO and Accessibility purposes.

โ‘ Let's explore 15 such HTML elements.
โžŠ abbr

โ‘ The <abbr> HTML element represents an abbreviation or acronym.

โ’ Its title attribute can provide an expansion or description for the abbreviation.

Use it when you want to
โœง provide expansion or description
โœง treat it separately (like styling)
โž‹ dfn

โ‘ If you want to indicate "a term" being defined within the context of a definition phrase or sentence, use <dfn> for that term.

โ’ If the <dfn> element has a title attribute, it must contain the term being defined and no other text.
โžŒ em

โ‘ The <em> HTML element marks text that has stress emphasis.

โ’ If you have a word or, few words in a sentence which have a stress emphasis compared to surrounding texts, use <em> element.

โ‘ It's often shown in italics. But that's browser dependent.
โž strong

โ‘ The <strong> HTML element indicates that its contents have strong importance, seriousness, or urgency.

โ’ Use it for a sentence or, few words that is of great importance to the whole page.

โ‘ It's often shown in bold. But that's browser specific.
โžŽ mark

โ‘ The <mark> HTML element represents text which is "marked" or "highlighted" for reference or notation purposes.

โ’ One of the best use cases of using this element is to indicate the words that matched a search operation.
โž small

โ‘ <small> renders the text within it one font-size smaller.

โ’ It represents side-comments and small print, like copyright and legal text.
โž q

โ‘ The <q> HTML element indicates that the enclosed text is a "short inline quotation".

โ’ This element is intended for short quotations that doesn't require paragraph breaks.

โ‘ Most browsers display the quoted text inside a quotation marks (" and ")
โž‘ blockquote

โ‘ The <blockquote> HTML element indicates that the enclosed text is an "extended quotation".

โ’ This is usually rendered with an indentation.
โž’ cite

โ‘ The <cite> HTML element is used to describe a reference to a cited creative work.

โ’ The creative work could be a tweet, a web page, a blog post, a song, a film, a game, a painting, a legal case report etc.

โ‘ Most browsers display the cited text in italics.
โž“ var

โ‘ The <var> HTML element represents the name of a variable in a mathematical expression or a programming context.

โ’ Most browsers may render it in italics.
โžŠโžŠ code

โ‘ The <code> HTML element displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code.

โ’ By default, the content text is displayed using the browser's default monospace font.
โžŠโž‹ kbd

โ‘ The <kbd> HTML element represents a span of inline text denoting textual user input from a
โ keyboard
โ voice input
โ any other text entry device
โžŠโžŒ samp

โ‘ The <samp> HTML element is used to enclose "inline text" which represents sample output from a computer program.

โ’ By default, the content text is displayed using the browser's default monospace font.
โžŠโž data

โ‘ The <data> HTML element links a given piece of content with a machine-readable translation.

โ’ The value attribute of this element specifies the machine-readable translation of the content.
โžŠโžŽ time

โ‘ The <time> HTML element represents a specific period in time.

โ’ It may represent one of the following:

โ A time on a 24-hour clock
โ A precise date in the Gregorian calendar
โ A valid time duration
โš ๏ธ Notice โš ๏ธ

โ‘ Did you notice? I didn't provide any code or, sample visuals for any of these elements.

โ’ Reason? I want you to explore these on your own. I have just given the reference. You could practice on your own to have a solid understanding.
๐Ÿ’ญ Feedbacks

โœง Did you find this thread useful?
โœง After reading through entire thread, have you learnt something worth?
โœง What improvements will you suggest?

Hey ๐Ÿ‘‹. I will be happy to hear from you. Your feedbacks would help me sharing better contents in future.
End of ๐Ÿงต

Hey ๐Ÿ‘‹ I am a Tech Educator from India ๐Ÿ‡ฎ๐Ÿ‡ณ

I am sharing Tutorials, Tips, Techniques, Infographics, Cheat Sheets, Interview Questions and Roadmaps on Web Development, DSA and, Database.

Are you interested? I am sure, you are.

To never miss anything, Follow Me โœ…

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Swapna Kumar Panda ๎จ€

Swapna Kumar Panda ๎จ€ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

Mar 20
How much JavaScript is good enough to start in React?

โ‡ฉ
๐Ÿ’ญ Why is this Thread?

โฌ˜ JavaScript and React both are popular and having a large share.

โฌ— I have often seen people jumping straight to React without much knowledge in JavaScript.

โฌ™ Is this a good idea? If no, then how much JavaScript knowledge is enough to start React?
๐Ÿ‘ฉโ€๐Ÿ’ป Beginning Words

โฌ– I suggest to start learning JavaScript first.

โฌ˜ If you start with React, you would frequently travel between JavaScript and React making the learning progress slower.

โฌ— Let's see how much JavaScript should be enough to start working in React.
Read 16 tweets
Mar 19
๐Ÿ’œ JavaScript: Array's length vs String's length
-
โ‡ฉ Array's length property is mutable whereas String's length p
โžŠ Introduction

In JavaScript,

โœง Array is an Object whereas String is a primitive

โœง Despite String being a primitive, for easy operations it has a lot of methods and, properties

โœง String is considered as Array-Like

โœง Both Array and, String has a "length" property
โž‹ Array's length

โœง Unlike many other languages, JavaScript actually allows to modify an array's length manually.

โœง If we set a larger length, few blank spaces (holes) are added to the end.

โœง If we set a smaller length, elements are removed from the end.
Read 7 tweets
Mar 18
๐Ÿ”  CSS Font Related Properties & Values
๐ŸŒ† Direct Link for High Resolution Image

If you liked this one, give a โญ๏ธ to this GitHub repo to support my work.

โœง Direct Link:
github.com/swapnakpanda/Iโ€ฆ
๐Ÿ“‹ Properties we covered

โžŠ font-family
โž‹ font-size
โžŒ font-weight
โž font-style
โžŽ font-variant
โž text-decoration
โž text-transform
โž‘ color
Read 14 tweets
Mar 17
๐Ÿฆพ 11 Modern JavaScript Hacks

โ‡ฉ
๐Ÿ’ญ Why is this Thread?

โ‘ The code we write should be readable and, maintainable. But that doesn't mean it should be verbose.

โ’ With ECMAScript new specifications, many newer syntaxes are available which we should try to use mostly.

โ‘ Let's explore few such modern tricks.
๐Ÿ“‹ Table of Contents

โžŠ Conversion to Number
โž‹ Conversion to Boolean
โžŒ Conversion to String
โž Complex String
โžŽ Short Circuit && / ||
โž Nullish Check
โž Default Value
โž‘ Default Function Parameter
โž’ Optional Chaining
โž“ Array Resizing
โžŠโžŠ Function Rest Parameter
Read 16 tweets
Mar 16
60+ Shorthand Properties : CSS Cheat Sheet

โ‡ฉ
๐ŸŒ† Direct Link for High Resolution Image

If you liked this one, give a โญ๏ธ to this GitHub repo to support my work.

โœง Direct Link:
github.com/swapnakpanda/Iโ€ฆ
Read 10 tweets
Mar 15
Why <!DOCTYPE html>?

โ‡ฉ
โžŠ History

โœง In the old days of the web, pages were written in two versions: One for Netscape Navigator, and one for Microsoft IE.

โœง When the web standards were made at W3C, browsers could not just start using them, as doing so would break most existing sites on the web.
โœง Browsers therefore introduced two modes to treat new standards compliant sites differently from old legacy sites.

โœง Modes were: Quirks Mode and Standards Mode.

โœง For HTML documents, browsers use a DOCTYPE in the beginning of the document to decide which mode to handle.
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(