Jump to content

Recommended Posts

Posted

In the course Building a Website: Part 5, I am inserting the following code with <div> and <span class> but the <div> creates an extra white space above the tagged area and the span class does not appear bolded in HTML. I am using Bluefish and viewing in Firefox.

 

<p>

If you want to learn webdesign <span class="makeBold"> you have come to the right place </span> here is a list

of the items and lets keep writing stuff to see what happens so that we understand the

difference between a div tag and span tag. <div> Going to keep writing to see if this breaks </div> or just keeps

going on and on and on

</p>

 

HTML View: (As you can see the white space above "Going" and the <span class inserted is not appearing in BOLD. Anyone have any feedback regarding what is causing this?

 

If you want to learn webdesign you have come to the right place here is a list of the items and lets keep writing stuff to see what happens so that we understand the difference between a div tag and span tag.

 

Going to keep writing to see if this breaks

or just keeps going on and on and on

Posted

You shouldn't have a div tag inside a p tag. Delete <div> and </div> and put them where they belong. You haven't shown all your code but it should be something like

<div>
<p>....<span class="makeBold">...</span>...</p>
<p>....</p>
</div>

 

Check for errors here:-

http://validator.w3.org/

Posted

Hello and thanks for the training! Excited to be here! I think I'm in a div? My other code above these lines should follow suite...

 

<div id="centerdoc">

 

<h3>THE PLACE TO LEARN WEBDESIGN!</h3>

 

<p>If you want to learn webdesign you have come to the right place</p>

 

<h3>THE PLACE TO LEARN WEBDESIGN!</h3>

 

<p>

If you want to learn webdesign <span class="makeBold"> you have come to the right place </span> here is a list

of the items and lets keep writing stuff to see what happens so that we understand the

difference between a div tag and span tag. <div> Going to keep writing to see if this breaks </div> or just keeps

going on and on and on </p>

 

<h3> XXX THE PLACE TO LEARN WEBDESIGN!</h3>

 

</div>

Posted

That's not quite right as you have <div>...</div> tags here which are inside the <p> tag:-

...span tag. <div> Going to keep writing to see if this breaks </div> or just keeps...

Delete <div> and </div>.

Posted
1342590423[/url]' post='33067']

yay! No spaces...I think I'm good on that.

 

Thanks again I'm sure I will be back for more genius ;-)

 

He didn't say anything about spaces, he said to not put div tags inside p tags.

Posted

Hello Andrea,

 

That is my mother's name. I was trying to accomplish a break in the sentence without it causing a space with the div tag. I was trying to follow the training video closely on this and that is what prompted the question. Maybe it easier to use a <br> tag?

 

Thanks for the feedback.

Posted
1342743192[/url]' post='33085']

Hello Andrea,

 

That is my mother's name. I was trying to accomplish a break in the sentence without it causing a space with the div tag. I was trying to follow the training video closely on this and that is what prompted the question. Maybe it easier to use a <br> tag?

 

Thanks for the feedback.

 

The br tag would be the correct tag for a line break.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...