Jump to content

css help


bogdaniel

Recommended Posts

hello i have a problem here with some code

 

 

css style:

 

		.wrapper {

		width:960px;
		background:#000;
		margin:0px auto;

		}




	.left_wrapper{

		float:left;
		background:yellow;
		width: 830px;



		}



	.content{

		float:right;
		background:red; 
		width:700px;

		}



	.col1 {

		float:left;
		background:green;
		width:130px;

		}




	.col2 {

		float:right;
		background:blue; 
		width:130px;

		}

 

html code:

 

<div class="wrapper">
<div class="left_wrapper">
  <div class="content">
    <p> </p>
    <p> </p>
        content
    <p> </p>
    <p> </p>
  </div>	
<div class="col1">
  <p> </p>
  <p> </p>
  left side
  <p> </p>
  <p> </p>
</div>
  </div>
<div class="col2">
  <p> </p>
  <p> </p>
      right side
  <p> </p>
  <p> </p>
</div>
</div>

 

 

and my problem is i can't add a header & footer can someone help me please ? i add them and the page goes over them. i added them in the first warpper not the second

Link to comment
Share on other sites

First off, what is the reason for putting a left wrapper? You've got the 3 column thing going on, and thats fine, but they're 3 separate entities, all floated. So you don't need to group 2 of them since they're floated left. The real thing to do is float them all left and then order them as they appear. For example: if you have the left column in the middle and it's floated left, it will align to the left of anything that isn't already floated to the left. But that's where it makes it confusing since div a can be typed after div b, but if it div a is floated to the left(and div b isn't), then div a will show up before div b. Anyways, look at the new code I posted:

 

<div class="wrapper">
  <div id="header">
     TEST HEADER
  </div>
  <div class="col1">
  <p> </p>
  <p> </p>
  left side
  <p> </p>
  <p> </p>
</div>
  <div class="content">
    <p> </p>
    <p> </p>
        content
    <p> </p>
    <p> </p>
  </div>


<div class="col2">
  <p> </p>
  <p> </p>
      right side
  <p> </p>
  <p> </p>
</div>
<div id="footer">
   TEST FOOTER
</div>
</div>

Link to comment
Share on other sites

First off, what is the reason for putting a left wrapper? You've got the 3 column thing going on, and thats fine, but they're 3 separate entities, all floated. So you don't need to group 2 of them since they're floated left. The real thing to do is float them all left and then order them as they appear. For example: if you have the left column in the middle and it's floated left, it will align to the left of anything that isn't already floated to the left. But that's where it makes it confusing since div a can be typed after div b, but if it div a is floated to the left(and div b isn't), then div a will show up before div b. Anyways, look at the new code I posted:

 

<div class="wrapper">
  <div id="header">
     TEST HEADER
  </div>
  <div class="col1">
  <p> </p>
  <p> </p>
  left side
  <p> </p>
  <p> </p>
</div>
  <div class="content">
    <p> </p>
    <p> </p>
        content
    <p> </p>
    <p> </p>
  </div>


<div class="col2">
  <p> </p>
  <p> </p>
      right side
  <p> </p>
  <p> </p>
</div>
<div id="footer">
   TEST FOOTER
</div>
</div>

 

thank you for your help :)

Link to comment
Share on other sites

hello i have a problem here with some code

 

 

css style:

 

		.wrapper {

		width:960px;
		background:#000;
		margin:0px auto;

		}




	.left_wrapper{

		float:left;
		background:yellow;
		width: 830px;



		}



	.content{

		float:right;
		background:red; 
		width:700px;

		}



	.col1 {

		float:left;
		background:green;
		width:130px;

		}




	.col2 {

		float:right;
		background:blue; 
		width:130px;

		}

 

html code:

 

<div class="wrapper">
<div class="left_wrapper">
  <div class="content">
    <p> </p>
    <p> </p>
        content
    <p> </p>
    <p> </p>
  </div>	
<div class="col1">
  <p> </p>
  <p> </p>
  left side
  <p> </p>
  <p> </p>
</div>
  </div>
<div class="col2">
  <p> </p>
  <p> </p>
      right side
  <p> </p>
  <p> </p>
</div>
</div>

 

 

and my problem is i can't add a header & footer can someone help me please ? i add them and the page goes over them. i added them in the first warpper not the second

 

 

i've never seen this kind of coding 2 container for 3 column .. what are trying to do ? perfect 3 column  ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.