Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 4th, 2010, 11:30 AM
Registered User
 
Join Date: Apr 2010
Location: Planet Earth
Posts: 70
Thanks: 4
Thanked 0 Times in 0 Posts
Default Question about <div> tag

Hello everyone!
I have a question about the <div> tag.
I understand that you use this tag when you want to group certain items together.
However, when you use this tag, it transfers everything in this tag to the next line.
If you use the <div> tag only to put stuff on a new line, is there any difference between <div> and <br />?
Reply With Quote
  #2 (permalink)  
Old April 4th, 2010, 12:12 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Try the following in your browser:
Code:
<div style="float: left">foo</div><div>bar</div>
As you can see, both foo and bar are displayed on the same line. CSS opens up the door for lots of nice things.
Reply With Quote
  #3 (permalink)  
Old April 4th, 2010, 01:12 PM
Registered User
 
Join Date: Apr 2010
Location: Planet Earth
Posts: 70
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by PeterPeiGuo View Post
Try the following in your browser:
Code:
<div style="float: left">foo</div><div>bar</div>
As you can see, both foo and bar are displayed on the same line. CSS opens up the door for lots of nice things.
Yes, I am currently reading about CSS.
So basically, with <div> you can align your text, while <br /> can't do that for you (it only makes a line break). Just wanted to make sure I got that right.
Also, the default value for <div> is center?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Container <div> and another ,div. not behaving as expected SouthendSupporter ASP.NET 3.5 Basics 8 December 15th, 2009 10:05 AM
How can I stop <DIV> tag wrapping sinkalanick CSS Cascading Style Sheets 3 February 19th, 2007 09:16 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
sizeable <div> johnjohn Javascript How-To 1 December 8th, 2004 08:28 PM
<A><DIV><TABLE></DIV></A> anshul HTML Code Clinic 2 July 17th, 2004 02:17 PM



All times are GMT -4. The time now is 08:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.