lbear Posted July 16, 2012 Report Share Posted July 16, 2012 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 Quote Link to comment Share on other sites More sharing options...
Wickham Posted July 16, 2012 Report Share Posted July 16, 2012 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/ Quote Link to comment Share on other sites More sharing options...
lbear Posted July 18, 2012 Author Report Share Posted July 18, 2012 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> Quote Link to comment Share on other sites More sharing options...
Wickham Posted July 18, 2012 Report Share Posted July 18, 2012 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>. Quote Link to comment Share on other sites More sharing options...
lbear Posted July 18, 2012 Author Report Share Posted July 18, 2012 yay! No spaces...I think I'm good on that. Thanks again I'm sure I will be back for more genius ;-) Quote Link to comment Share on other sites More sharing options...
Andrea Posted July 18, 2012 Report Share Posted July 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
lbear Posted July 20, 2012 Author Report Share Posted July 20, 2012 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. Quote Link to comment Share on other sites More sharing options...
Andrea Posted July 20, 2012 Report Share Posted July 20, 2012 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.