Fun Trivia | Quizzes | Games | People | Services | Help | Me
Register - Log In
Sign up NOW for your free FunTrivia account. Compete, join teams, and meet people!
Cascading Style Sheets For Dummies

Crafted by Trivia Architect Lutrine

Fun Trivia : Quizzes : Software and Programming : Cascading Style Sheets For Dummies

Introduction:
"CSS offers a way to separate styles and presentation from the content of an HTML document, simplifying page design and creation. Most modern websites make heavy use of this, but do you know enough to hold your own in the world of web development?"


1. Before a Cascading Style Sheet is useful, you need to include one into your HTML page. What HTML tag can you use to apply CSS rules to a document?
    css
    sheet
    script
    style


2. The HTML 'link' tag allows you to include an external style sheet into your document, as if it had been defined there in a 'style' tag. What is the equivalent rule in CSS?
    @media
    @link
    @include
    @import


3. Now to start defining some CSS rules! How do I set the colour of all text on the page to red? (Due to technical restrictions, the curly braces have been substituted for square brackets.)
    @all [ foreground-color: red ]
    * [ foreground-color: red ]
    * [ color: red ]
    * [ font-color: red ]


4. Can you explain what the following property means?

border: 2px solid #FF0000
    A two pixel gap around the element. The element is solid with a blue background
    A two pixel thick, solid blue border
    A two pixel thick, solid red border
    A two pixel gap around the element. The element is solid with a red background


5. The CSS 'box model' describes a rectangular area around an element, used when laying out elements on the page. Which three properties affect the box model?
    distance, margin, border
    margin, padding, border
    margin, padding-outer, padding-inner
    position, margin, padding


6. I've applied borders around all four edges to every cell in a table. (The table itself has no border.) However, the borders between cells are twice as thick as I wanted them to be. I want them to be the same width as the borders on the edges of the table. What should I add to the rule for the 'TD' element to accomplish this?
    border-adjacent: combine
    table-border: uniform
    border-collapse: collapse
    table-border: internal-join


7. I have a document that contains a single image and several paragraphs of text below it. I want to place the image on the left of the page and have the text wrap around it on the right side. How do I do this?
    Set the "text-wrapping: right" style on the paragraphs
    Set the "text-align: right" style on the paragraphs
    Set the "position: left" style on the image
    Set the "float: left" style on the image


8. I have a simple document containing a long paragraph of text (P) with an image (IMG) placed roughly in the middle of the text. There are no styles in the document yet. I want to place the image 8 pixels higher than its normal, unstyled position - what should I add to the image's 'style' attribute to achieve this?
    position: relative; top: -8px;
    top: -8px;
    position: relative; top: 8px;
    position: absolute; top: 8px;


9. I have a DIV element containing a lot of content (text, images etc.). I want to restrict the width and height of the DIV element, limiting the amount of content visible at any time, but still allow the user to view all of its contents.
    overflow: scroll
    overflow: allow
    overflow: visible
    All of these are acceptable


10. Lots of websites have links that change colour when you move your cursor over them. This is implemented in CSS nowadays, though many newbies are unaware of this non-obvious solution. What selector represents an A tag that has the cursor over it?
    a.mouseover
    @selected
    a:hover
    a:selected


report error/typo/spelling mistake (new window)
Copyright, FunTrivia.com. All Rights Reserved.
Legal / Conditions of Use