liveBook · Manning

CSS

As explained in Rust Servers, Services, and Apps

CSS is a stylesheet language for specifying the presentation and visual styling of structured documents such as HTML.

CSS is a stylesheet language for specifying the presentation and visual styling of structured documents such as HTML. In these web applications, an HTML page links a separate stylesheet, which the browser downloads and applies while retrieving the page. section 8.2 section 2.3.5

A stylesheet applies declarations through selectors to shape page presentation:

  • Serve the stylesheet as a static file with the text/css content type so the browser can apply it to an HTML page. section 2.3.5

Styling a registration page

A registration template links /static/tutor-styles.css. The stylesheet centers the registration panel, adds a border and padding, colors the header, places a background image behind the page, and fixes the footer to the bottom. Run the Actix server and open the registration URL to inspect the result.

How Rust Servers, Services, and Apps covers it

How deep it goes
Demonstrates selectors, declarations, layout, colors, backgrounds, and positioning through examples, without developing CSS internals.
Examples
Shows a registration stylesheet, a red-heading stylesheet, linked HTML pages, background images, buttons, and a fixed footer.
What it assumes
Assumes familiarity with HTML templates and web-server file serving while treating CSS constructs as standard examples.
What you can do after
Builds basic stylesheets, links them from HTML, serves them statically, and verifies applied styling in a browser.
How it connects
Connects CSS with HTML, static assets, web servers, browsers, HTTP content types, and server-rendered templates.

Also explained in

Compare how 13 books explain CSS →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.