How to get a child div to span the entire parent div

Hello,
  Need some help,,

How do I get the child div to span the entire parent div.. I am using bootstrap and have footer and I would like to have two equal column with icon..

Here is a plunk
http://plnkr.co/edit/JXC6Frq3OReTmdH76NEm?p=preview

I would like each div to size to the parent

Here is code
 <footer class="footer navbar-fixed-bottom" style="background:red;height:4em">
      <div class="container-fluid">
      	<div class="row">
			<div class="col-xs-6 col-md-6 footerSeachButton">
				<a class="button" href="#">
	                <div>
	                  <span class="glyphicon glyphicon-search" aria-hidden="true"> </span>    
	                  <span>Search</span>
	                </div>
	              </a>
			</div>
			<div class="col-xs-6 col-md-6 footerLoginButton">
				<a class="button" href="#">
                <div>
	                  <span class="glyphicon glyphicon-search" aria-hidden="true"> </span>    
	                  <span>Login - Register</span>
                </div>
              </a>
  			</div>
		</div>
		</div>
		</footer>

Open in new window


.footerLoginButton
 {
 
  background:#00308f;
 }
 .footerSeachButton
 {
 	background:#2175d9;
 }

Open in new window


Thanks
chand pbAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You will want to place the nested div inside a row class. I have a more simplified example http://plnkr.co/edit/JXC6Frq3OReTmdH76NEm?p=preview  note the top vs the bottom with the row class nested.

<!DOCTYPE html>
<html>

  <head>
    <link data-require="bootstrap@3.3.2" data-semver="3.3.2" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
    <script data-require="bootstrap@3.3.2" data-semver="3.3.2" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
    <script data-require="jquery@2.1.3" data-semver="2.1.3" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  </head>

  <body>
    <!-- top -->
<div class="row green threehundred">
  <div class="col-xs-6 red">stuff</div>
  <div class="col-xs-6 blue threehundred">
    <div class="col-xs-12 purple">more</div>
  </div>
</div>
<hr>
<!-- bottom -->
<div class="row green threehundred">
  <div class="col-xs-6 red">stuff</div>
  <div class="col-xs-6 blue threehundred">
    <!-- add row class above nested div -->
    <div class="row">
      <div class="col-xs-12  purple">more</div>
    </div>
  </div>
</div>

  </body>

</html>

Open in new window

chand pbAuthor Commented:
Thanks .. but it did not seem  work for me . I would like the height to span the entire length of the parent


here is the plunk of your example

http://plnkr.co/edit/rnTPHbTuMg43TQncbmIG?p=preview

As you can see  the red and purple span horizontally but not vertically...

sorry ..
chand pbAuthor Commented:
Do I have to give each child div (red and purple) a height of  300..?



Thanks
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I thought you meant horizontal.    For vertical you will just set your containing row to whatever height you need. In a live site you are not going to have 3 or 4 colors like this sample.  Apply your background color and height to the containing row or nav or footer.

If you still require the height of a child div to be the same height of  a parent div and the parent div can change heights on the fly, then you will use javascript/jquery to detect the change in window height or container height, on each change, figure the height of the container and apply to the child.  This is a good example of how that can be done http://www.nicholasbarger.com/posts/jquery-makes-100-height-so-much-easier but honestly, if you feel you need this perhaps there is a better way.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I didn't see your 2nd post.  You can give each a height, but like I said, the container height should be all you need. If the height is static, then css will do the trick.

If you have uneven columns like

<div class="row">
     <div class="col-xs-6">one line</div>
     <div class="col-xs-6">
        <p>one</p><p>two</p><p>three</p>
    </div>
 </div>

Open in new window

Then the row will always be the height of the tallest column.  You can use a minimum height too.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.