HTML CSS back to the basics

Jeevachaithanyan Sivanandan - Oct 8 '23 - - Dev Community

We all know HTML and CSS but it is always better to look back to the basics and re-assure we know the basic. Here are some questions related to HTML that I have found a bit difficult but good to learn again.

  • Which two elements are used to mark-up subscript and superscript text?

  • Which markup is correct in the below list?

<date time="2025-10-08">October 8, 2025</date>
Enter fullscreen mode Exit fullscreen mode
<date>October 8, 2025</date>
Enter fullscreen mode Exit fullscreen mode
<datetime time="2025-10-08">October 8, 2025</datetime>
Enter fullscreen mode Exit fullscreen mode
<time datetime="2025-10-08">October 8, 2025</time>
Enter fullscreen mode Exit fullscreen mode
  • Which code produces the output shown in the image below?

using sub and sup

2<sub><small><small> 5</small></small></sub><sup>8</sup>
Enter fullscreen mode Exit fullscreen mode
2<sup><small><small> 8</small></small></sup><sub>5</sub>
Enter fullscreen mode Exit fullscreen mode
2<sup><small><small> 5</small></small></sup><sub>8</sub>
Enter fullscreen mode Exit fullscreen mode
  • Which markup is correct in below list?
<date time="2025-10-08">October 8, 2025</date>```





Enter fullscreen mode Exit fullscreen mode

October 8, 2025```

<time datetime="2025-10-08">October 8, 2025</time>
Enter fullscreen mode Exit fullscreen mode
  • Why would you want to use the w specification in srcset instead of the x specification?

  • Which one is pseudo class and which one is pseudo element in the below code ?

p:first-of-type {

}
p::first-letter {

}
Enter fullscreen mode Exit fullscreen mode
  • What is margin collapsing?

  • When a float needs to be cleared using the parent element, what “display” value should be used?

  • "flex" is the shorthand property for which three longhand properties?

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .