Sonzaschool
Back

O-Level · Form 2 · Vocational · Electronics and Computer

Computer Programming

Implementing graphics in webpages using CSS

about 3 minutes to read

Discussions
Topics in this sectionFormatting web pages with Cascading Style Sheets (CSS)5 topics

Adding Graphics to Webpages with CSS

CSS (Cascading Style Sheets) not only styles text and layouts — it also controls how images and graphical elements appear on a webpage. By using CSS properties, you can add background images, resize them, round corners, and add shadows to create attractive web designs.


The background-image property inserts an image behind an element, such as a heading, a paragraph, or the whole page.

body {
    background-image: url("market.jpg");
}

The URL inside url() can point to a local image file in your project folder or an address on the internet.


How you'll be assessedProcess assessment · Outcome assessment · Knowledge assessment

Process assessment

  • Apply background images using backgroundimage.
  • Adjust background size using backgroundsize.
  • Add rounded corners using borderradius.
  • Add shadows using boxshadow.
  • Test graphics implementation

Outcome assessment

Web pages displaying properly styled and positioned graphics that enhance visual appeal without affecting performance are implemented.

Knowledge assessment

Methods used: The student should explain how to:

  • implement graphics using CSS. Principles: The student should explain the principle of:
  • layering of backgrounds and shadows.

Theories: The student should explain:

  • Concepts of graphics
  • CSS properties for background and borders.

Circumstantial knowledge:

Detailed knowledge about:

  • performance optimization for graphics.

Question

Which CSS property is used to add a background image behind an element?

Sign in to submit your answer and have it count toward your mastery.

Sign in to practice

Tutor

Stuck? Ask me anything about this topic.

Sign in to ask the Sonza AI Tutor about this question.

Sign in to ask

Discussions

No questions yet

Sign in to ask
Loading discussions…