What are the steps to create two frames using Twitter Bootstrap?

I'm just starting to work with Twitter Bootstrap and I need some help. Can someone assist me in creating a two-column layout inside the HTML, where the menu in the header stays visible even when scrolled down? I've included my HTML code below. Thanks!

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta charset="utf-8">
        <title>Teacher</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <style type="text/css">`
            /* CSS used here will be applied after bootstrap.css */
            body{
            margin-top: 1px;
            }
            .divide-nav{
            height: 80px;
            background-color: #428bca;
            }
            .divide-text{
            color:#fff;
            line-height: 20px;
            font-size:20px;
            padding: 15px 0;
            }
            .affix {
            top: 1px;
            width:100%;
            }
            .filler{
            min-height: 2000px;
            }
            .navbar-form {
            padding-left: 0;
            }
            .navbar-collapse{
            padding-left:0; 
            }
            #footer {
            height: 60px;
            background-color: #f5f5f5;
            }
        </style>
        <style type="text/css"></style>
    </head>
    <body>
        <div class="divide-nav">
            <div class="container">
                <p class="divide-text"><img src ="musar-logo.png"></p>
            </div>
        </div>
        <nav class="navbar navbar-default navbar-lower affix-top" role="navigation">
            <div class="container">
                <div class="collapse navbar-collapse collapse-buttons">
                    <form class="navbar-form navbar-left" role="search">
                        <button class="btn btn-success">Button</button>
                        <button class="btn btn-default">Button</button>
                        <button class="btn btn-default">Button</button>
                        <button class="btn btn-default">Button</button>
                    </form>
                </div>
            </div>
        </nav>
        <frameset cols="25%,*,25%">
            <frame src="1.html">
            <frame src="it.html">
            <frame src="it.html">
        </frameset>
        <div class="container">
            <div class="row">
                <div class="filler"></div>
            </div>
        </div>
        <div class="modal-body row">
            <div class="col-md-6">
                <!-- Your first column here -->
            </div>
            <div class="col-md-6">
                <!-- Your second column here -->
            </div>
        </div>
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/bootstrap.min.js"></script>
        <!-- JavaScript jQuery code from Bootply.com editor  -->
        <script type="text/javascript">
            $(document).ready(function() {

                $('.navbar-lower').affix({
            offset: {top: 50}
            });

            });

        </script>
        <div id="footer">
            <div class="container">
                <p class="text-muted credit">Footer Trial</a></p>
            </div>
        </div>
    </body>
</html>

Answer №1

Expanding upon the previous response, I have created a fiddle to demonstrate the concepts mentioned. http://jsfiddle.net/w7s2o90e/1/

<title>Teacher</title>
    <!-- HTML code from Bootply.com editor -->
    <body>
        <div class="divide-nav">
            <div class="container">
                <p class="divide-text"><img src ="musar-logo.png"></p>
            </div>
        </div>
        <nav class="navbar navbar-default navbar-lower affix-top" role="navigation">
            <div class="container">
                <div class="collapse navbar-collapse collapse-buttons">
                    <form class="navbar-form navbar-left" role="search">
                        <button class="btn btn-success">Button</button>
                        <button class="btn btn-default">Button</button>
                        <button class="btn btn-default">Button</button>
                        <button class="btn btn-default">Button</button>
                    </form>
                </div>
            </div>
        </nav>
        <frameset cols="25%,*,25%">
            <frame src="1.html">
            <frame src="it.html">
            <frame src="it.html">
        </frameset>
 <div class="row-fluid">
   <div id="left" class="col-sm-4">
     <div id="allYourContent" class= "col-sm-12">
    </div>
     </div>
  <div id="right" class="col-sm-8">
    <!--Body content-->
  </div>
 </div>
</div>
        <div id="footer">
            <div class="container">
                <p class="text-muted credit">Footer Trial</a></p>
            </div>
        </div>
    </body>

To create fixed size and scrolling on the left side, include the following in your CSS:

overflow:scroll   

The two columns described above will only display once you add content or specify their sizes (refer to the fiddle). I utilized

class="col-sm-4" & class="col-sm-8"

instead of "span," but the functionality should be similar.

I made adjustments to some parts of your code, maintaining the overall structure and objective you were aiming for.

Answer №2

To achieve the desired layout, you can create a two-grid setup. For more information and detailed instructions, visit http://getbootstrap.com/2.3.2/scaffolding.html

<div class="container-fluid">
 <div class="row-fluid">
   <div class="span2">
     <!--Add content for sidebar here-->
    </div>
  <div class="span10">
    <!--Main body content goes here-->
  </div>
 </div>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to create a non-reactive value in Vue.js?

In my Vue.js app, I am facing an issue where an array value is becoming reactive even though I want it to remain un-reactive. The array should only be updated when a specific "refresh" action is completed. However, every time a new value is assigned to the ...

Tips on resolving the Cross-Origin Read Blocking (CORB) error when blocked cross-origin response while using Postman

After making a call to a third party API using Jquery's AJAX function, the console is showing the following error: The Cross-Origin Read Blocking (CORB) protocol has blocked a cross-origin response from https://example.com/assets/front/font/fonts.m ...

A dysfunctional JS object

I am grappling with a rather intricate object and have simplified it by removing unnecessary functions. However, I am facing an issue when I try to initialize it and I can't figure out the reason behind it. Safari is throwing this error at me: [Error] ...

Shifting the key of a choropleth map with R, rMaps, and datamaps

My challenge is to center the legend below a choropleth map of the United States. I don't have much experience with JS or CSS, but I decided to delve into the datamaps.all.min.js file in the R-3.2.1\library\rMaps\libraries\datamaps ...

The unit tests are passing successfully

Trying to create unit test cases for a web API call. This one showcases success: Success Unit Test (jsfiddle) getProduct("jsonp","https://maps.googleapis.com/maps/api/e Here is an example of an error, but the test result still shows "pass": Error ...

Update the chosen option in a dropdown list with jQuery and javascript

I need to set the value of a column in a repeater so that once it's assigned, the column will display the current selection from the dropdown. I have the correct value to assign in $('#myname_' + rowIndex).text(), but when I try to assign t ...

Retrieve the output of a function that was invoked by the getJSON method

In the scenario where $.getJSON() successfully retrieves JSON data, a designated function is executed. Is there a way for me to capture the value returned by this function as output? $.getJSON(url, function(data) { // Perform operations with data u ...

Steer clear of receiving null values from asynchronous requests running in the background

When a user logs in, I have a request that retrieves a large dataset which takes around 15 seconds to return. My goal is to make this request upon login so that when the user navigates to the page where this data is loaded, they can either see it instantly ...

Sending form array information using jQuery AJAX

My form allows for the addition of multiple listings simultaneously. Additionally, there is a requirement to pass through an md5check. For example: <select name="master_id"></select> <select name="id2[]"></select> <select nam ...

Can I utilize p5.Vector.fromAngle() in Vue JS?

Incorporating P5 into a Vue application can be achieved using the following code snippet: let script = p5 => { p5.setup = _ => { this.setup(p5) } p5.draw = _ => { this.draw(p5) } } this.ps = new P5(script) While functions like ba ...

Verify the front-end application and authenticate the backend REST API

My project involves developing a REST API and application logic on the client-side, keeping them separate and independent of each other. Now I am looking to implement an authentication system that will automatically authenticate users both on the client-si ...

The dynamic URL parameters are altered by the Browser's back button

I am currently working on a website where the URL parameter is updated based on user actions. This update triggers changes in the webpage without the need for refreshing. An example scenario would be in an E-commerce site where the URL changes when the use ...

Ensure that the view remains consistent while navigating a table that contains expanding concealed information

My table is dynamically populated with data within a div that has overflow: scroll and height set properties. The issue I face is that the data populates from the top, making it difficult to keep track of specific rows when scrolling within the #container ...

Having a quandary with Socket.io when using clients.length (where clients refers to io.sockets.clients();)

Typically, when sending JSON from one client to another, everything works smoothly. However, if there is only one client, packets are still being sent. To address this issue (on the server-side in node.js), I implemented the following solution: var client ...

What is the best way to modify the size of the letter background?

I'm facing an issue with a word that has a background color. While using the CSS property background-color: blue, allows me to give the word a background color and display: inline-block helps in sizing it exactly to the word, the problem arises when I ...

propagate the previous state using a variable

Currently, I am in the process of refactoring a codebase but have hit a roadblock. My main aim is to update the state when the onChange event of a select box occurs. Specifically, the parameter searchCriteria in my handleFilterChange function is set to in ...

Unexpected object returned by the spread operator

Currently, I am utilizing node and specifically using babel-node. "start": "nodemon --exec babel-node --presets es2015 index.js" However, I have encountered an issue with my spread syntax in the following code snippet: export const login = async (parent ...

jQuery AJAX returning an unexpected null value instead of JSON data

I'm currently working on a contact form that uses AJAX to submit data to a PHP file for processing. However, I'm facing some issues with retrieving the JSON object back into the AJAX command as it keeps returning null. Below is the code snippet t ...

Issue with cookies modification in Next.js 14 server actions

I'm currently facing a challenge while working on a Next.js 14 project where I am trying to make changes to cookies. Despite carefully following the Next.js documentation regarding server actions and cookie manipulation, I keep running into an error w ...

There was an issue encountered while parsing the JSON data - "SyntaxError: Unexpected token . was caught."

Encountering an error in Chrome while parsing JSON data. The JSON sample can be found at this link. It is valid JSON and the server is sending the correct Content-Type value (application/json). Uncaught SyntaxError: Unexpected token . Firefox shows a sli ...