hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
    arrow
    arrow
    arrow
    In a HTML page, if the background image is smaller than the screen, what will happen?
    Question

    In a HTML page, if the background image is smaller than the screen, what will happen?

    A.

    It will be repeated

    B.

    It will be stretched

    C.

    It will get clipped

    D.

    It will leave a blank space at the bottom of your page

    Correct option is A

    By default, a CSS/HTML background set with background-image (or the legacy <body background="...">) uses background-repeat: repeat.
    That means the image tiles both horizontally and vertically to fill the viewport or element’s box.
    No automatic stretching or clipping occurs unless additional properties are specified.
    You can change this behavior with background-repeat: no-repeat, repeat-x, or repeat-y.
    For scaling, use background-size: cover or contain; for positioning, use background-position.
    Thus, a smaller background image repeats/tiles by default.
    Important Key Points

    1. Default repeat: background-repeat defaults to repeat (tiling on both axes).
    2. Disable tiling: Use no-repeat to show the image only once.
    3. Scale image: background-size: cover|contain|<length|%> controls stretching/scaling.
    4. Positioning: background-position sets where the first tile is placed (e.g., center, top left).
    5. Attachment: background-attachment: fixed pins the background while content scrolls.
    6. Element scope: Rules apply to any element, not just <body>.

    Knowledge Booster

    • Why (b) is wrong: Stretching doesn’t happen by default; it needs background-size (e.g., cover or 100% 100%).
    • Why (c) is wrong: Clipping is not the default; tiling fills the space.
    • Why (d) is wrong: No blank area appears by default—tiling covers the entire page unless no-repeat is set.

    Free Tests

    Free
    Must Attempt

    UP SI 2025 Full Mock Test : 01

    languageIcon English
    • pdpQsnIcon160 Questions
    • pdpsheetsIcon400 Marks
    • timerIcon120 Mins
    languageIcon English
    Free
    Must Attempt

    UP Police Constable Full Mock Test 01

    languageIcon English
    • pdpQsnIcon150 Questions
    • pdpsheetsIcon300 Marks
    • timerIcon120 Mins
    languageIcon English
    Free
    Must Attempt

    Government Policies and Scheme

    languageIcon English
    • pdpQsnIcon10 Questions
    • pdpsheetsIcon20 Marks
    • timerIcon5 Mins
    languageIcon English
    test-prime-package

    Access ‘UPSSSC’ Mock Tests with

    • 60000+ Mocks and Previous Year Papers
    • Unlimited Re-Attempts
    • Personalised Report Card
    • 500% Refund on Final Selection
    • Largest Community
    students-icon
    354k+ students have already unlocked exclusive benefits with Test Prime!
    Our Plans
    Monthsup-arrow