Web Designing and Publishing

CSS ( Cascading Style Sheet )

  1. CSS Stands for :
    1. Color style sheet
    2. Cyclone Style Sheet
    3. Circular style sheet
    4. Cascading Style Sheet
    Answer : D
  2. External stylesheets are saved as extension ?
    1. .htcs
    2. .css
    3. .js
    4. .cjs
    Answer : B
    Explain: We save external css file with an extension of .css and attach in html with the help of link tag.
  3. How can we change the background color of an element ?
    1. color
    2. bgcolor
    3. background-color
    4. All of above
    Answer : C
    Explain: The background-color property set the background color of an element.
  4. In HTML, the correct place to put external css file in ?
    1. body
    2. head
    3. at the starting of html file
    4. at the end of file
    Answer : B
    Explain: The best way to put an css file in html is in head section. By using link tag.
  5. Which of following is not a type of CSS file ?
    1. Inline
    2. External
    3. Internal
    4. None of above
    Answer : D
    Explain: There are three types of CSS : External, Internal and Inline.
  6. Which HTML tag is used to define Internal Style Sheet ?
    1. <link>
    2. <a>
    3. <css
    4. <style>
    Answer : D
    Explain: 'style' tag is used to link internal style sheet. To link external we use 'link' tag.
  7. Which of following is correct way to link External Style Sheet ?
    1. <link type="text/css" href="cssfile">
    2. <link type="text/css" a="style.css">
    3. <link rel="stylesheet" type="text/css" src="style.css">
    4. <link rel="stylesheet" type="text/css" href="style.css">
    Answer : D
    Explain: Proper syntax to add external css file is : <link rel="stylesheet" type="text/css" href="filename.css">
  8. In how many ways CSS written ?
    1. 3
    2. 1
    3. 0
    4. 5
    Answer : A
    Explain: CSS can be written in 3 ways: Inline, External, and Internal CSS.
  9. Which of following is correct css syntax for h1 tag ?
    1. { h1= color:black; }
    2. { h1-color:black; }
    3. h1{ color:black; }
    4. h1-css{ color:black; }
    Answer : C
    Explain: tag/.class/#id-name { color : color-name ;}, here above case we have given tag name. So h1 { color: black;} is correct.
  10. Which symbol is use in CSS for 'id' selector ?
    1. *
    2. #
    3. .
    4. /
    Answer : B
    Explain: To use an ID selector in CSS, you simply write a hashtag (#) followed by the ID of the element.
  11. How do we insert comment in CSS file ?
    1. /* this is comment */
    2. <!--this is comment>
    3. // this is comment//
    4. #this is comment#
    Answer : A
    Explain: To comment in CSS, simply place your plain text inside /* */ marks. Single or multiple line use this.
  12. What is meaning of 'margin: 0 auto' ?
    1. top, bottom, left and right is zero.
    2. top, bottom, left and right is adjust automatically
    3. top and bottom is 0, left and right are equally to make content center
    4. the content display center .
    Answer : C
    Explain: margin: 0 auto, the top/bottom margin is 0, and the left/right margin is auto. Auto means that the left and right margins are automatically set by the browser to make the element centered.
  13. Which property is used to give space between content and border ?
    1. padding
    2. margin
    3. space
    4. gap
    Answer : A
    Explain: An element's padding area is the space between its content and its border.
  14. The body of the style sheet includes ____ ?
    1. Style rules
    2. CSS rules
    3. Sheet rules
    4. Format rules
    Answer : B
    Explain: A style sheet consists of a list of rules which is declare by CSS.
  15. The ____ property allows to indent the first line of text in an element ?
    1. text-first
    2. text-indent
    3. first-indent
    4. text-first-indent
    Answer : B
    Explain: The text-indent property specifies the indentation of the first line in a text-block. You can also give negative value.
  16. Are the negative values allowed in padding property ?
    1. Yes
    2. NO
    3. can't say
    4. May be
    Answer : B
    Explain: No. Padding only takes positive values. Negatives are ignored or treated as 0
  17. What is true about Conflicting Styles ?
    1. Conflict occurs as styles can be defined by a user, an author or a user agent ( e.g, a web browser)
    2. Styles "cascade", or flow together
    3. Ultimate apperance of elements depends on a combination of styles defined in a several ways.
    4. Style defined by the user agent take precedence over styles defined by the user.
    Answer :
    Explain: CSS conflicts mean when we give a property to tag and in that tag there is a class. So the class property enable on it. Example we p{ color: blue} but in paragraph we have class= ph. We use .ph{ color: red;}, now the class has higher precedence. Last color is 'red'.

Next Set

2 3

Make sure you make notes of these question. We hope it helps you.