Loading, please wait ...
Open its course - Web Engineering

Short Questions for Conflicting styles

  • 1 How many positioning schemes are there that help in page layout? Describe them briefly.

    Answer
    There are three positioning schemes that allow you to control layout of a page: normal , float , and absolute positioning.

    Normal Flow

    The block-level elements within a page will flow from top to bottom, and inline elements will flow from left to right.

    Float

    Allows you to specify how you want to control the position for a box with values like static, relative, absolute and fixed.

    Absolute

    Takes an element out of normal flow, allowing you to fix its position by giving it the position property with a value of absolute


  • 2 Can we import one style sheet file into another? How some css rules can be given the precedence over another rule?

    Answer
    @import imports another style sheet into the current style sheet. It should appear right at the start of the style sheet before any of the rules, and its value is a URL

    !important indicates that some rules should take precedence over others.


  • 3 What is the difference between display and visibility properties in CSS?

    Answer
    The display property force an element to be either a block-level or inline box. Use the value none to indicate that the box should not be displayed, it is treated as if it were not in the markup at all.


    While the visibility property allows us to hide a box from view with a value of hidden you do not see the content of the element.


  • 4 How can you generate contents using CSS?

    Answer
    The :before and :after pseudo-elements are added to the selector and then the content property is used to specify what should be inserted into the document. These pseudo-classes enable us to add text before or after each instance of an element defined in a selector
    for example:
    p.abstract:after {content: “You need to register to read the full article.”; color:#ff0000;}


    By default, the element created using these pseudo-classes will be inline unless you use the display property with a value of block


  • 5 List the table specific CSS properties with brief description.

    Answer
    Five properties that can only be used with tables are:

    • border-collapse Where the borders of two table cells touch, this property indicates whether both borders should be visible, or whether the browser should pick just one of the borders to show.
    • border-spacing Specifies the width of the space that should appear between table cells.
    • caption-side Specifies which side of a table the caption should appear on.
    • empty-cells Specifies whether the border should be shown if a cell is empty.
    • table-layout If the space you have allocated for a table is not enough to fit the contents, browsers will often increase the size of the table to fit the content in— this property can force a table to use the dimensions you specify


  • 6 How can you control the shape or appearance of the marker/bullet point or number for a list?

    Answer
    We can set it using the list-style-type property which can be assign any of the values from "none, disc(default) a filled-in circle, circle, square a filled-in square".


  • 7 When you specify a background-image, and the box is bigger than the image, then how can you set the image to fill up the whole box?

    Answer
    By using the background-repeat property with any of the following value:

    • repeat This causes the image to repeat to cover the whole page (it is the default therefore rarely used).
    • repeat - x The image will be repeated horizontally across the page (not down the whole page vertically).
    • repeat - y The image will be repeated vertically down the page (not across horizontally).
    • no-repeat The image is displayed only once.


  • 8 Discuss some pseudo-classes that give you more control over the presentation of links?

    Answer

    • link Styles for links in general
    • visited Styles for links that have already been visited
    • hover Styles for when someone is hovering over a link
    • active Styles for links that are currently active (being clicked)


  • 9 Explain the default behavior of browsers for links. List the CSS properties with description that allow you to customize them.

    Answer
    The default behavior of most browsers show links in blue with an underline and change the color of links you have already visited.

    The following are properties often used with links:

    • color : Changes the colors of the links
    • background - color : Highlights the link, as if it had been highlighted with a highlighter pen
    • text - decoration : Commonly used to control whether the link is underlined or not, although it can also specify that text should have a strikethrough, blink, or be overlined


  • 10 Explain the functionality of overflow CSS property.

    Answer
    Sometime the content you want to fit in the box might require more space than you have allowed for it. The overflow property was designed to deal with these situations and provide us the following values to set it:

    • hidden: The overflowing content is hidden.
    • scroll: The box is given scrollbars to allow users to scroll to see the content.


  • 11 List some CSS properties through which you can control the dimensions of a box. Very briefly describe each property.

    Answer
    The following CSS properties gives us control to control the dimensions of a box:

    • height: sets the box height
    • width: sets the box width
    • line-height: sets the height of a line of text
    • max-height: sets the maximum height for a box
    • max-width: sets the maximum width for a box
    • min-height: sets the minimum height for a box
    • min-width: sets the minimum width for a box


  • 12 How CSS gives you control over the border of a box?

    Answer
    CSS provides the following properties through which we can control the border of a box:

    • border-color: indicate the color of border. You can individually change the color of the bottom, left, top, and right sides
    • border-style: indicate whether a border should be a solid, dashed, or double line, or one of the other possible values
    • border-width: indicate the width a border


  • 13 Write CSS with text color set to '#000000', background set to '#ffffff', Font be 'arial' then 'verdana' then 'sans-serif', font size set to 12px and line height should be 24px.

    Answer

    .divsettings {
    color:#000000;
    background-color:#ffffff;
    font-family:arial, verdana, sans-serif;
    font-size:12px;
    line-height:24px;
    }


  • 14 What are the properties of a box in box model for a web page? Describe each briefly.

    Answer
    Every box has three properties

    1. border: Even box has a border. This separates the edge of one box from other surrounding boxes.
    2. margin: The margin is the distance between the border of a box and the box next to it.
    3. padding: This padding is the space between the content of the box and its border.


Contact Us

support@subexpert.com
Write to Us View Help
Subject Expert Logo

Subject Expert

Learn, Evaluate and Optimize

Follow Us
Facebook Switch Display Mode Enable Translation
© 2024 - Subject Expert