Grokking CSS for Web Development
Vote

0% completed

​

CSS Height

Give a box no height at all, and the browser still makes it exactly as tall as its content. The product card below has no height declaration, and Chrome draws it 100.81 pixels tall, which is the space its heading and paragraph need. This chapter styles that same card in every lesson, so start by pasting the full page into a file and opening it in your browser.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Product card</title> <style> .card {

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content