Answer : D
Explain: Proper syntax to add external css file is : <link rel="stylesheet" type="text/css" href="filename.css">
In how many ways CSS written ?
3
1
0
5
Answer : A
Explain: CSS can be written in 3 ways: Inline, External, and Internal CSS.
Which of following is correct css syntax for h1 tag ?
{ h1= color:black; }
{ h1-color:black; }
h1{ color:black; }
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.
Which symbol is use in CSS for 'id' selector ?
*
#
.
/
Answer : B
Explain: To use an ID selector in CSS, you simply write a hashtag (#) followed by the ID of the element.
How do we insert comment in CSS file ?
/* this is comment */
<!--this is comment>
// this is comment//
#this is comment#
Answer : A
Explain: To comment in CSS, simply place your plain text inside /* */ marks. Single or multiple line use this.
What is meaning of 'margin: 0 auto' ?
top, bottom, left and right is zero.
top, bottom, left and right is adjust automatically
top and bottom is 0, left and right are equally to make content center
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.
Which property is used to give space between content and border ?
padding
margin
space
gap
Answer : A
Explain: An element's padding area is the space between its content and its border.
The body of the style sheet includes ____ ?
Style rules
CSS rules
Sheet rules
Format rules
Answer : B
Explain: A style sheet consists of a list of rules which is declare by CSS.
The ____ property allows to indent the first line of text in an element ?
text-first
text-indent
first-indent
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.
Are the negative values allowed in padding property ?
Yes
NO
can't say
May be
Answer : B
Explain: No. Padding only takes positive values. Negatives are ignored or treated as 0
What is true about Conflicting Styles ?
Conflict occurs as styles can be defined by a user, an author or a user agent ( e.g, a web browser)
Styles "cascade", or flow together
Ultimate apperance of elements depends on a combination of styles defined in a several ways.
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'.