[XHTML/CSS] odstęp właściwości border

Otóż chcę uzyskać efekt odstępu tła od obramowania bloku tak jak na obrazku:

borderv.png

Zrobiłem to sam w taki sposób:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

[/code]

[code]body { margin: 0; padding: 0; position: relative; top: 2px;} p { font-family: tahoma, verdana, arial, sans-serif; padding: 0; margin: 0;} #wrapper { border: 1px solid #666; width: 930px; margin: auto;} #content { margin: 1px; background: #dcdcdb; padding: 5px;} #blok_border { border: 1px solid #666; width: 400px;} #blok { background: #fff; margin: 5px;} #blok p{ padding: 5px; color: #993333; font-size: 13px;}

Jak widać tworzę specjalnie blok który jest tylko po to by miał obramowanie a jego dziecko dostaje tło i margines 1px przez co jest ten odstęp. Ale jest problem bo gdy wchodzę w to głębiej :twisted: to działa ale ten odstęp jest po prostu jakby dziurą w dokumencie i widać to co jest pod nim a ja chcę aby on był zawsze biały.

border2y.png

Tutaj aby dokładniej było widać odstęp między tłem tekstu (białym) a obramowaniem bloku jest 5px i wtargnął tam kolor z bloku nadrzędnego, chodzi o to aby ten odstęp był biały.

Dzięki za każdą pomoc, wskazówkę. Nie interesuje mnie podkład obrazka jako tło. Wiem, że istnieje właściwość border-spacing ale nie umiem tego wykorzystać, testowałem tylko na mozilli :confused:

Dodane 01.03.2010 (Pn) 17:58

Refresh