I created an outer container called <div id="box">
and another inner container called <div id="innerbox">
I pasted two paragraphs of lorem ipsum into "box" with "innerbox" in the middle of them, using this HTML code:
CODE
<div id="box">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec sapien metus, euismod eget, vulputate ut ...etc
<div id="innerbox">
<p>Curabitur posuere velit eget enim. Vivamus id ligula. Pellentesque est nisl, lobortis ... etc.
</p>
/div>
Integer congue volutpat urna. In non justo vel eros porta vehicula, ... etc
</p>
</div>
Firstly, is it legal to have an inner div in the middle of a paragraph or should the paragraph be terminated first (</p>) and then restarted (<p>) after the innerbox div?
Anyway, this is what happened ...
The font properties (size and colour) defined for #box p were:
1. displayed by the ist paragraph in "box" (starting with 'Lorem ispsum ...')
2. inherited by the text inside "innerbox" (starting with ' Curabitur posuere ...)
3. but ignored by the text below the innerbox.
So, when I made the color: red; Lorem ipsum, in the outer box, was red; Curabitur posuere in the inner box, was red; but Integer congue, in the outer box, below the innerbox, was still the original black.
If I played around with float commands to get the lower paragraph to wrap around the inner box, it made no difference: the text in the upper part of the outer box was red, the text in the inner box was red; but the second paragraph in the outerbox was black, even though wrapped around the inner box, and contiguous with the first paragraph in the outerbox.
I would be very much obliged if you could tell me what this means (it is not a problem, but good for my education)
Many thanks, James.
BTW - I note in the tutorial that in HTML you have, for example, <div id=box> with id values not surrounded by quotes - am I doing it wrong, or is it optional, or there a preference for one or the otrher?