@@Der Martin
Gibst du keine Breite an (lässt es also beim Defaultwert auto), macht der Browser das Element so breit wie möglich
Wenn die display
-Eigenschaft des Elements den Wert block
hat. Bei inline
macht der Browser das Element so schmal wie möglich.
Daher musste man oft böse tricksen, wenn ein Layout mit definierten Breiten im IE und in standardkonformen Browsern annähernd gleich aussehen sollte.
Der Trick war eine DOCTYPE-Angabe, die den Browser in den Standard-Modus schickt. Deshalb schleppen wir das sonst eigentlich völlig unnütze <!DOCTYPE html>
immer noch mit uns rum.
😷 LLAP
--
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon