Twitter Bootstrap 3 - max height, custom layout

mrzepinski

I have something like this:

+-------------------------------------------+
|             -- navigation --              |
+------+------------------------------------+
|      |                                    |
| left |                                    |
| side |                                    |
| with |                                    |
| affix|           -- content (white) --    |
| menu |                                    |
|-black|                                    |
|      |                                    |
|      |                                    |
|      +------------------------------------+
|      |           -- footer (white) --     |
+------+------------------------------------+

as my layout in TB 3.0, and some code:

<body>
    <header>
        <div class="row">
            <div class="col-md-12>-- navigation (height = 50px) here --</div>
        </div>
    </header>

    <div class="row">
        <div class="col-md-4">-- left side with black background here --</div>
        <div class="col-md-8">
            <div class="row">
                <div class="col-md-12">-- content with white background here --</div>
            </div>

            <div class="row">
                <div class="col-md-12">-- footer (height = 50px) with white background here --</div>
            </div>
        </div>
    </div>
</body>

I want make my left side (with black background) and content (white background) with height = 100% of my browser window and footer (white background) below my content to be visible (also on scroll).

For now, I get height of last element of the side. If my content is short, it ends for example in the center of vertical side of my browser.

Here is it: http://codepen.io/anon/pen/FxImy

avrahamcool

Pure CSS Solution (using calc)

If you can use CSS3, and this 50px height is static, you can use calc to achieve your layout.

Here's a DEMO

HTML

<header>
        Header
</header>
<div id="Container">
    <div id="Left">I'm in the left menu</div>
    <div id="Right">
        <div id="Content">Content</div>
        <footer>Footer</footer>
    </div>
</div>

CSS

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

header, footer
{
    height: 50px;

    background-color: yellow;
    text-align: center;
}
#Container, #Content
{
    height: calc(100% - 50px);
    overflow: auto;
}
#Left, #Right
{
    height: 100%;
}
#Left
{
    float: left;
    background-color: black;
    color: white;
}
#Right
{
    overflow: auto;
}

If the height is not static, I have another solution for you, that I demonstrate here it's not excatly your layout, but it can be done the same way.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Twitter Bootstrap 3 - max height, custom layout

From Dev

Fixed layout height with scrollable in Twitter bootstrap 3.2.0

From Java

Twitter bootstrap 3 two columns full height

From Dev

Twitter Bootstrap 3 responsive full height grid

From Dev

Twitter Bootstrap 3 responsive full height grid

From Dev

Twitter bootstrap 3 custom multiple theme's

From Dev

Twitter Bootstrap grid layout

From Dev

How to fit tall image at the screen's height (Twitter Bootstrap 3)?

From Dev

Center a 9-column layout using twitter bootstrap 3

From Dev

Height issue in Chrome with jquery Isotope in responsive layout with Bootstrap 3

From Dev

Full height layout with collapse and fixed sidebar on bootstrap 3

From Dev

Consistent full height vertical sizing with Bootstrap 3 layout?

From Dev

BootStrap 3 - NavBar with Dropdown, Extension of a Dropdown is out of max height

From Dev

Twitter bootstrap 3 - create a custom glyphicon and add to glyphicon "font"

From Dev

Max width with twitter bootstrap label

From Dev

Max width with twitter bootstrap label

From Dev

Bootstrap 3 - 100% height of custom div inside column

From Dev

Full Height, fluid 100% width and height, 2 column Bootstrap 3 layout with header

From Dev

Bootstrap NavBar Max-Height

From Dev

How to to over-ride the height of my footer using Bootstrap v3 Twitter

From Dev

UIView min and max height with Auto Layout

From Dev

UIView min and max height with Auto Layout

From Dev

twitter bootstrap select silviomoreto increase height

From Dev

Twitter Bootstrap : vertically align child div with height

From Dev

Twitter Bootstrap Legacy: Uniform height on spans

From Dev

twitter bootstrap fill height with Stashy sidebar flyout

From Dev

Twitter Bootstrap - changing height of checkboxes in form

From Dev

Twitter Bootstrap : vertically align child div with height

From Dev

Bootstrap 3 - Height of the NavBar

Related Related

  1. 1

    Twitter Bootstrap 3 - max height, custom layout

  2. 2

    Fixed layout height with scrollable in Twitter bootstrap 3.2.0

  3. 3

    Twitter bootstrap 3 two columns full height

  4. 4

    Twitter Bootstrap 3 responsive full height grid

  5. 5

    Twitter Bootstrap 3 responsive full height grid

  6. 6

    Twitter bootstrap 3 custom multiple theme's

  7. 7

    Twitter Bootstrap grid layout

  8. 8

    How to fit tall image at the screen's height (Twitter Bootstrap 3)?

  9. 9

    Center a 9-column layout using twitter bootstrap 3

  10. 10

    Height issue in Chrome with jquery Isotope in responsive layout with Bootstrap 3

  11. 11

    Full height layout with collapse and fixed sidebar on bootstrap 3

  12. 12

    Consistent full height vertical sizing with Bootstrap 3 layout?

  13. 13

    BootStrap 3 - NavBar with Dropdown, Extension of a Dropdown is out of max height

  14. 14

    Twitter bootstrap 3 - create a custom glyphicon and add to glyphicon "font"

  15. 15

    Max width with twitter bootstrap label

  16. 16

    Max width with twitter bootstrap label

  17. 17

    Bootstrap 3 - 100% height of custom div inside column

  18. 18

    Full Height, fluid 100% width and height, 2 column Bootstrap 3 layout with header

  19. 19

    Bootstrap NavBar Max-Height

  20. 20

    How to to over-ride the height of my footer using Bootstrap v3 Twitter

  21. 21

    UIView min and max height with Auto Layout

  22. 22

    UIView min and max height with Auto Layout

  23. 23

    twitter bootstrap select silviomoreto increase height

  24. 24

    Twitter Bootstrap : vertically align child div with height

  25. 25

    Twitter Bootstrap Legacy: Uniform height on spans

  26. 26

    twitter bootstrap fill height with Stashy sidebar flyout

  27. 27

    Twitter Bootstrap - changing height of checkboxes in form

  28. 28

    Twitter Bootstrap : vertically align child div with height

  29. 29

    Bootstrap 3 - Height of the NavBar

HotTag

Archive