Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Getting jumbotron to strech around javascripts and tables

I can't seem to get jumbotron to stretch/fit to my page when i have javascripts and or tables in it. Even though the <div class="jumbotron"> is set ouside all the cointainers on the screen and the styling as the height set to 100%

had trouble pasting the code into the question so added it here: http://www.codeshare.io/LeD6Z

5 Answers

Timothy coxon
Timothy coxon
18,633 Points

You have a height attribute on all the parents? html, body etc etc?

No. It is a ruby on rails application so the parents are gouped in this file:

<!DOCTYPE html>
<html>
    <head>
        <link rel="shortcut icon" href="wave.ico" type="image/ico">
        <title>InstaWaves</title>
        <%= include_gon %>
        <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
        <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
        <%= csrf_meta_tags %>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
    </head>
    <body class='<%= controller.controller_name %>'>
        <%= render partial: "elements/navbar" %>
        <%= bootstrap_flash %>

        <%= yield %>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    </body>
</html>
Timothy coxon
Timothy coxon
18,633 Points

Fairly sure I remember something about if you want "height:100%;" then all the parent elements need to have a height defined also...

html, body {margin:0;padding:0;height:100%;}

http://stackoverflow.com/questions/21357238/css-height-100-percent-not-working

((it was height you wanted?))

Yes, it was height.

That did not work either. The jumbotron stretches to 100% screen height but doesn't wrap around the table.

http://oi57.tinypic.com/2ajykib.jpg

Timothy coxon
Timothy coxon
18,633 Points

Hmm table looks like it needs a clearfix.. you have a url I can view this at? tricky to work it out from just a screenie..

http://nicolasgallagher.com/micro-clearfix-hack/

I have not deployed it yet, so can't link to webapp to you sorry .

The problem with jumbotron nok wrapping to 100% of screen is the same on multiple pages, no matter if there is a table there or not.

Think it is the javascripts that messes it up. Pages with only google maps api has the same problem