Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Bidut Sharkar Shemanto
Bidut Sharkar Shemanto

Posted on

     

HTML, CSS Interview Question&Answer

1) What Do You Understand By The Universal Selector?

Answer:
The universal selector (*) in CSS applies styles to all elements on a web page. It is used to set a common style for all elements without needing to specify each one individually.

2) Differentiate Between The Use Of ID Selector And Class Selector.

Answer:

  • ID Selector (#): Used to style a single, unique element. Each ID must be unique within a document.
  • Class Selector (.): Used to style multiple elements that share the same class. Multiple elements can have the same class.

3) How Can You Use CSS To Control Image Repetition?

Answer:
CSS propertybackground-repeat controls image repetition. For example:

  • background-repeat: repeat; repeats the background image both horizontally and vertically.
  • background-repeat: no-repeat; prevents the background image from repeating.
  • background-repeat: repeat-x; repeats the image horizontally.
  • background-repeat: repeat-y; repeats the image vertically.

4) Are The HTML Tags And Elements The Same Thing?

Answer:
No, HTML tags and elements are not the same.

  • Tags: The code surrounded by angle brackets, such as<div>.
  • Elements: The combination of the opening tag, content, and closing tag, such as<div>Content</div>.

5) Difference Between Inline, Block, And Inline-Block Elements. Is It Possible To Change An Inline Element Into A Block-Level Element?

Answer:

  • Inline Elements: Do not start on a new line and only take up as much width as necessary (e.g.,<span>,<a>).
  • Block Elements: Start on a new line and take up the full width available (e.g.,<div>,<p>).
  • Inline-Block Elements: Behave like inline elements but can have width and height set like block elements.

Yes, it is possible to change an inline element into a block-level element using CSS:

.element{display:block;}
Enter fullscreen modeExit fullscreen mode

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

✍I write on IoT, Machine Learning, Web Development🔗Let's connect on LinkedIn: https://www.linkedin.com/in/shemanto/
  • Location
    Khulna,Bangladesh
  • Education
    Khulna Univarsity of Engineering and Technology (KUET), Bangladesh
  • Joined

More fromBidut Sharkar Shemanto

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp