4 Replies - 832 Views - Last Post: 28 February 2012 - 07:47 PM

#1 JGAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-July 11

Can't get rid of margins... Collapsed margins?

Posted 27 February 2012 - 02:43 PM

Hello,
I'm getting started in website development. I use Dreamweaver CS5 on my Mac. My website is http://www.c4-band.com/index.php.

The problem is that there is a space between the bottom of the navbar and the body wrapper that I'm trying to get rid of. I have tried all the margin tags and stylesheets I can find, and it still won't work. The navbar is a spry menu bar preset fyi :P I read something about "collapsed margins," but I'm not really sure if this is the issue or how to fix it. Does anybody have any fixes?

The navbar CSS is available at http://www.c4-band.c...rHorizontal.css

Thanks,
JGAN

Is This A Good Question/Topic? 0
  • +

Replies To: Can't get rid of margins... Collapsed margins?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Can't get rid of margins... Collapsed margins?

Posted 27 February 2012 - 03:14 PM

Hey.

There are a lot of problems in that HTML. You seem to be opening and closing <body> tags all over the place. (There should only be one, enclosing the entire body of the page.) - Use the W3C Markup Validation Service to make sure you HTML is valid. Valid HTML = fewer display issues and less trouble getting things working across all browsers.

The space between you navbar and the wrapper div would probably be caused by the three <br/> tags in between them.


By the way, if you are starting out in web development, using the visual tools provided by IDEs like Dreamweaver is a very bad idea. It hides all the important things a web developer needs to know. - If you want to be a decent web developer it's not enough to just know how to work the Dreamweaver IDE. You need to understand how the underlying technologies work; how to work with the raw HTML and CSS without the aid of an IDE. - Only when you can do that should you consider using an IDE like Dreamwever.
Was This Post Helpful? 0
  • +
  • -

#3 JGAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-July 11

Re: Can't get rid of margins... Collapsed margins?

Posted 28 February 2012 - 12:54 PM

thanks, that did it :) i also used the validation service to fix the code. however, just one more question: where should i place body tags? around the main section, or the entire page (from header to footer)?
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Can't get rid of margins... Collapsed margins?

Posted 28 February 2012 - 03:46 PM

Around the body of the page. That is: around ALL the HTML that should be visible on the page.

This is where you HTML pages should start from:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Site title</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<!-- All the meta-data should go in the head section -->
	</head>
	<body>
		<!-- All your content should go in the body section -->
	</body>
</html>


Of course, you can change the doctype according to your needs. Just remember to adjust the other elements to match it. - For instance, the <meta> tag should be self-closed in XHTML documents, and it should be replaced by <meta charset="utf-8"/> in HTML5.
Was This Post Helpful? 0
  • +
  • -

#5 JGAN  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-July 11

Re: Can't get rid of margins... Collapsed margins?

Posted 28 February 2012 - 07:47 PM

ok got it thanks a lot!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1