Fighting with CSS questions – a way from newbie to master CSS

May 8, 2007

8th ques: CSS quiz from w3schools

Filed under: --- Level: 2, ♥ List of CSS Questions — cssquestions @ 5:36 pm

I’ve copied it here so we can discuss about it.

1.     What does CSS stand for?

Creative Style Sheets
Computer Style Sheets
Cascading Style Sheets
Colorful Style Sheets

2.     What is the correct HTML for referring to an external style sheet?

<style src=”mystyle.css”>
<stylesheet>mystyle.css</stylesheet>
<link rel=”stylesheet” type=”text/css” href=”mystyle.css”>

3.     Where in an HTML document is the correct place to refer to an external style sheet?

In the <body> section
In the <head> section
At the top of the document
At the end of the document

4.     Which HTML tag is used to define an internal style sheet?

<css>
<script>
<style>

5.     Which HTML attribute is used to define inline styles?

font
class
style
styles

6.     Which is the correct CSS syntax?

body {color: black}
{body;color:black}
body:color=black
{body:color=black(body}

7.     How do you insert a comment in a CSS file?

/* this is a comment */
// this is a comment //
‘ this is a comment
// this is a comment

8.     Which property is used to change the background color?

color:
bgcolor:
background-color:

9.     How do you add a background color for all <h1> elements?

h1.all {background-color:#FFFFFF}
h1 {background-color:#FFFFFF}
all.h1 {background-color:#FFFFFF}

10.     How do you change the text color of an element?

text-color=
fgcolor:
color:
text-color:

11.     Which CSS property controls the text size?

font-style
font-size
text-style
text-size

12.     What is the correct CSS syntax for making all the <p> elements bold?

p {text-size:bold}
<p style=”font-size:bold”>
<p style=”text-size:bold”>
p {font-weight:bold}

13.     How do you display hyperlinks without an underline?

a {decoration:no underline}
a {text-decoration:no underline}
a {underline:none}
a {text-decoration:none}

14.     How do you make each word in a text start with a capital letter?

text-transform:capitalize
text-transform:uppercase
You can’t do that with CSS

15.     How do you change the font of an element?

font=
f:
font-family:

16.     How do you make the text bold?

font-weight:bold
style:bold
font:b

17.     How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?

border-width:5px 20px 10px 1px
border-width:10px 5px 20px 1px
border-width:10px 1px 5px 20px
border-width:10px 20px 5px 1px

18.     How do you change the left margin of an element?

margin-left:
text-indent:
margin:
indent:

19.     To define the space between the element’s border and content, you use the padding

property, but are you allowed to use negative values?

Yes
No

20.     How do you make a list that lists its items with squares?

type: 2
type: square
list-type: square
list-style-type: square

About these ads

3 Comments »

  1. 1. Cascading Style Sheets
    2. <link rel=”stylesheet” type=”text/css” href=”mystyle.css”> Though I’ve never tried external css
    3. head ofcouse
    4. style
    5. style
    6. body {color: black}
    7. /* this is a comment */
    8. background-color:
    9. h1 {background-color:#FFFFFF}
    10. text-color:
    11. font-size
    12.
    13. a {text-decoration:none}
    14. I don’t know
    15. font-family:
    16. font-weight:bold
    17. don’t know
    18. margin-left:
    19. It should be yes for this kind of question
    20. list-style-type: square

    Comment by Trang do — May 9, 2007 @ 4:28 pm

  2. 12. <p style=”font-size:bold”>

    Comment by Trang do — May 9, 2007 @ 4:29 pm

  3. 2. You should try :)
    10. color
    12. the 4th
    14. the 1st
    17. the 3rd
    border-width:10px 1px 5px 20px
    because:
    border-width: Top Right Bottom Left

    Tip to remember: you’re in TrouRBLe.

    19. No

    Comment by cssquestions — May 12, 2007 @ 6:05 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Banana Smoothie Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: