logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > HTML and CSS
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-24-2012, 05:04 AM   #1
nikibi
 
Join Date: Feb 2012
Posts: 2
Default cannot make it in the middle....

Hello everybody,

I've already type below css but it didn't show the box and in the middle.

Code:
body {
	margin:0;
	padding:0;
	color:#FF0;
	background-color:#26a;
}

#outerGroup {
	width:700px;
	margin:0 auto;
	padding:1em 2em;
	background-color:#fff;
	color:#000;
}
and also please check my source code too:


Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sample</title>
<link href="test.css" rel="stylesheet" type="text/css" media="screen,projection" />
<link href="style-test.css" rel="stylesheet" type="text/css" media="screen,projection" />
</head>

<body>
<div id="outerGroup">
<div id="header"><h1>Hello nikibi</h1>
</div>
<div id="contentGroup"> 
<h2>I'm learning CSS</h2>
<div id="globalheader">
<ul id="glabaknav">
<li id="ch-A for apple">A for apple</a></li>
<li id="ch-B for boy">B for boy</a></li>
</ul>
</div>
<hr class="colb"/>
Hello
hehe haha hoho
<h2>I'm learning CSS</h2>
<h3>I'm learning CSS</h3>
<h2>I'm learning CSS</h2>
<h4>I'm learning CSS</h4>
</div>
<hr/>
<div id="footer">goodbye</div>

</body>
</html>

thank you for your help!

Last edited by Corrosive; 02-25-2012 at 09:50 AM.. Reason: wrapped code
nikibi is offline   Reply With Quote
Old 02-25-2012, 09:45 AM   #2
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Your div tags are unbalanced so I don't think you've closed the 'outergroup' div to make the page centre
Corrosive is offline   Reply With Quote
Old 02-25-2012, 09:49 AM   #3
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

To add to that, this can be avoided if you comment each closing div tag. I use this method but you can find your own;

Code:
<div id="wrapper" class="outer"></div><!--\#wrapper .outer-->
By my comment (<!--\#wrapper .outer-->) I mean that the div with ID wrapper and class outer is closed with that closing tag. That way, when it appears half way down the page I know that my div is closed.

Hope that helps make sense of the chaos!
Corrosive is offline   Reply With Quote
Reply


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:14 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com