By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

simple layout question

P: n/a
Hi,

I have the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtm11/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>crap</title>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="./inline_style.css"/>
</head>
<body>
<div class="box1">
<img src="./king.jpg" alt="box1"/>
</div>
<div class="box2">
<p>
box2 some text
</p>
<p>
some more text
</p>
</div>
</body>
</html>

and my stylesheet is:

..box1 {display: inline;
}

..box2 {display: inline;
}

..box1 img {display: inline;
width: 100px;
height: 100px;
}

Why does the "box2 some text" and "some more text" not appear next to the
image? Does <pnot inherit the inline from <div>?

Regards

Michael
Oct 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Mon, 16 Oct 2006 10:51:08 +0800, in
comp.infosystems.www.authoring.stylesheets "Michael"
<mi*********@yahoo.comwrote:
>Why does the "box2 some text" and "some more text" not appear next to the
image? Does <pnot inherit the inline from <div>?
Have you tried {float: [left/right]}?
--
Money can't buy happiness, but it can let you rent it for a while...
Oct 16 '06 #2

P: n/a
"Michael" <mi*********@yahoo.comwrote:
>I have the following:
[code snipped]

Don't post code to the group, upload it, post the url.

--
Spartanicus
Oct 16 '06 #3

P: n/a
On 2006-10-16, Michael <mi*********@yahoo.comwrote:
[snip]
Why does the "box2 some text" and "some more text" not appear next to the
image? Does <pnot inherit the inline from <div>?
It doesn't.

If you add

p {display: inherit;}

or

p {display: inline;}

then the <p>s are inline.

If you look at the "Full Property Table" in Appendix F in the back of
CSS 2.1 it tells you which properties are inherited.
Oct 16 '06 #4

P: n/a

"Ben C" <sp******@spam.eggswrote in message
news:sl*********************@bowser.marioworld...
On 2006-10-16, Michael <mi*********@yahoo.comwrote:
[snip]
>Why does the "box2 some text" and "some more text" not appear next to the
image? Does <pnot inherit the inline from <div>?

It doesn't.

If you add

p {display: inherit;}

or

p {display: inline;}

then the <p>s are inline.

If you look at the "Full Property Table" in Appendix F in the back of
CSS 2.1 it tells you which properties are inherited.
Thanks :-)
Oct 16 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.