adding position:absolute cause borders to disappear for nested elements

9 views
Skip to first unread message

Tolick

unread,
Jul 19, 2010, 5:44:05 AM7/19/10
to CSS
In the following example: adding position:absolute cause borders to
disappear for nested elements. Why?

<!doctype html>
<head>
<style>
.outer {
border: 1px solid black;
}

.inner {
border: 1px solid gray;
}
</style>
</head>
<body>
<div style="position: absolute;">
<span class="outer">
<span class="inner">
hello
</span>
</span>
</div>
</body>

Kristjan Robam

unread,
Dec 22, 2019, 9:35:57 AM12/22/19
to CSS
Because everything goes absolute . . . 

With the best wishes,
Kristjan
E-mail: robamman2019 at aol . com
Reply all
Reply to author
Forward
0 new messages