Some Important interview questions of CSS?

CSS

Some Important interview questions of CSS?

Q 1 What is the Box Model in CSS?

Ans - The Whole Content of HTML goes in the form of a square. It consists of padding, margin, border, and the actual content. box model describes how these elements work together.

Q.2 What are the Different Types of Selectors in CSS & what are the advantages of them?

Ans - mainly two different types of selectors in CSS

  1. pseudo-class selectors

  2. pseudo-element selectors

    pseudo-class selectors - these are keywords used to define a special state of an HTML element such as - :hover :active :link :visited :first-Child :focus etc

    pseudo-element selector - it is also a keyword used to specify a part of an element for example - before content or after content in an element

    pseudo-element selector- ::after ::before ::first-line ::marker etc

    Q.3 What does CSS do?

    Ans - you can add a new look to your old HTML document

    you can completely change look and styling with CSS

    4) How can you integrate CSS on a web page?

    There are three methods to integrate CSS on web pages.

    1. Inline method - It is used to insert style sheets in HTML document

    2. Embedded/Internal method - It is used to add a unique style to a single document

    3. Linked/Imported/External method - It is used when you want to make changes on multiple pages.

      5) What are the advantages of CSS?

      • Bandwidth

      • Site-wide consistency

      • Page reformatting

      • Accessibility

      • Content separated from the presentation

        6) What are the limitations of CSS?

        • Ascending by selectors is not possible

        • Limitations of vertical control

        • No expressions

        • No column declaration

        • Pseudo-class not controlled by dynamic behavior

        • Rules, styles, and targeting specific text are not possible

          7) What are the CSS frameworks?

          CSS frameworks are the preplanned libraries that make easy and more standard-compliant web page styling. The frequently used CSS frameworks are: -

          • Bootstrap

          • Foundation

          • Semantic UI

          • Gumby

          • Ulkit

            8) Why background and color are separate properties if they should always be set together?

            There are two reasons behind this:

            • It enhances the legibility of style sheets. The background property is a complex property in CSS, and if it is combined with color, the complexity will further increase.

            • Color is an inherited property while the background is not. So this can make confusion further.

9) What are the advantages of Embedded Style Sheets?

  • You can create classes for use on multiple tag types in the document.

  • You can use selector and grouping methods to apply styles in complex situations.

  • No extra download is required to import the information.