div tags - Not sure if I'm using them properly

liunx

Guest
Alrighty, here's my CSS script:

#interactive {
color: #5500AA;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
font-style: italic;
}

Here's my html code:

<p>Here is some text talking about the activity! <div id="interactive">It's
Interactive!</div> Just click the button to begin.</p>

Unfortunately when I test the page is looks like this:

Here is some text talking about the activity!

It's Interactive!
Just click the button to begin.

Why does it put paragraph breaks in where I applied the div tags? I want this all to be one sentence with the text formatting applied to "It's Interactive!".Div is a block level element, you'll want an inline level element, like span for this:

<p>Here is some text talking about the activity! <span id="interactive">It's
Interactive!</span> Just click the button to begin.</p>How would the CSS look? Do I need to end with </span>. I'm so new to this and the books I purchased are a little over my head at this point. Thanks for your help!First post has been edited, didn't see that typo. the CSS would exactly the sameYep, I just figured it out. Thanks for your help!
 
Back
Top