Angular.js <div ng-include> not expanding to the full height of the viewport

My goal is to create a single-page app with a scrolling effect using Angular.Js. Each ng-include section within the

<div class="viewport" ng-include="'views/file'" ng-controller="MainCtrl"></div>
should fill the viewport entirely. However, I am facing issues achieving this.

I have set the html and body to 100% in CSS, and applied the same to each ng-include element. Despite this, I am unable to make each div fill the viewport as intended. I suspect that the parent HTML and body elements are not being sized properly in percentage, as the logic dictates that the children should fill their parent percentage-wise.

  <body ng-app="myappApp">
    <div id="sidebar-back-drop"></div>
    <div class="row">
    <div id="sidebar-bar-static" class="col-xs-2">
        <a href="#fakelink" id="button" class="btn btn-block btn-md btn-inverse">Home</a>
        <a href="#fakelink" id="button" class="btn btn-block btn-md btn-inverse">Weather</a>
        <a href="#fakelink" id="button" class="btn btn-block btn-md btn-inverse">Stocks</a>
        <a href="#fakelink" id="button" class="btn btn-block btn-md btn-inverse">News</a>
    </div>
    </div>
    <!--[if lt IE 7]>
      <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->

    <!-- Add your site or application content here -->
    <div class="viewport" ng-include="'views/home.html'" ng-controller="MainCtrl"></div>
    <div class="viewport" ng-include="'views/first.html'" ng-controller="MainCtrl"></div>
    <div class="viewport" ng-include="'views/first.html'" ng-controller="MainCtrl"></div>
    <div class="viewport" ng-include="'views/first.html'" ng-controller="MainCtrl"></div>
    </div>
    <!--[if lt IE 9]>
    <script src="bower_components/es5-shim/es5-shim.js"></script>
    <script src="bower_components/json3/lib/json3.min.js"></script>
    <![endif]-->

    <!-- build:js scripts/vendor.js -->
    <!-- bower:js -->
    <!-- endbower -->
    <!-- endbuild -->

        <!-- build:js({.tmp,app}) scripts/scripts.js -->
        <script src="scripts/app.js"></script>
        <script src="scripts/controllers/main.js"></script>
        <!-- endbuild -->
</body>

CSS:

html {
    height: 100% !important;
    width: 100%;
    margin: 0px;
}

body {
    background-color: #f39c12;
    overflow: hidden;
    height: 100% !important;
}

#title {
}

#sidebar-bar-static {
    margin-left: 25px;
    position: fixed;
    color: #1abc9c #34495e;
}

#sidebar-back-drop {
    margin-left: 12px;
    margin-top: 10px;
    width: 124px;
    height: 181px;
    position: fixed;
    background-color: #1abc9c;
    border-radius: 6px;
}

#button {
    width: 121px;
    height: 41px;
}

.viewport {
    height: 100% !important;
}

Answer №1

It appears that a closing tag is missing:

#button {
  width: 121px;
  height: 41px;
} // <----- this one is not present in your code.

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

Implement a feature in JSP that allows users to dynamically add or remove fields before submitting the data to the database

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http- ...

Navigating Through Siblings with Http Agility Pack

When it comes to working with the HTML Agility Pack, it's easy to extract descendants and entire tables. However, how can you utilize this tool in a unique situation like the example below? ...Html Code above... <dl> <dt>Location:</dt ...

javascript highchart image carousel

I am currently working on a visual chart project using the JavaScript library highchart. After setting up my chart with some dummy data, I am looking to incorporate functionality that allows for triggering an image slide based on the chart data. Specific ...

Using the device's width and height with material-ui

Currently, I am attempting to specify the width and height for only the (Iphone 7 Plus) within my project using withStyles. import { withStyles } from "@material-ui/core"; I have tested the following code: "@media (width: 414px) and (height ...

CSS: Apply unique padding to the last element without the use of additional classes

My challenge involves a div housing three images, each about 31% in width. The goal is to have padding between them, with the final image having no right padding so that collectively they match the width of a larger image above. Here's an example... ...

Tips for creating a responsive container for mobile and smaller devices using Bootstrap 3

Apologies in advance for the lengthy post, but I welcome any suggestions and ideas. Thank you! I'm facing an issue with my layout breaking when the screen size is below 1200px (images and text drop down). I don't mind if they stack vertically on ...

"Failure to Update: Ajax Auto-Refresh Table Failing to Refresh

I'm facing a tricky issue with my code that I just can't seem to resolve. Currently, I am using Ajax and setTimeout to retrieve data. The problem arises when the data doesn't refresh automatically (if I manually navigate to the page getdata. ...

The homepage is not converting to a different language

Using the WPML plug-in for my WordPress website has been successful in translating most of my pages, but I am running into an issue with the home page. Even though I have manually translated and published the home page, it still does not translate when cli ...

Angular app sends a notification to nearby JQuery app about an occurring event

I'm currently working with an Angular 1.5 application within a jQuery environment. I need to find a way to alert the surrounding page or jQuery application when certain events, such as validation issues, occur in my AngularJS app. Any suggestions on h ...

What is the best way to position a div in the top right corner of my form using Bootstrap?

I have a form displaying some detailed text about elements in my application. Located outside this form is an "add new item" button that redirects the user to a new page for adding a new item. The current placement of this button is on the upper left corn ...

The border in my HTML table is not displaying when I run my flask application

My flask application was running smoothly in a virtual environment until I encountered an issue with the html borders not showing up. Even after seeking help from a friend who knows some html, the problem still persists. app.py: from flask import Flask, r ...

Displaying a Facebook iframe on the left side of the page

I'm struggling with positioning the Facebook iframe embed to sit on the left of the text. I want it to be aligned with the left margin, but also have the text flow beside it from the same height. Can anyone offer some guidance on how to achieve this u ...

In AngularJS, if you use $q with the sequence then() followed by catch() and then() again, you can halt the execution of

Here's a concise version of the code that I'm using: var makeRequest = function (method, url, query, data) { var request = { method: method, url: url, params: query || {}, paramSerializer: '$httpParamSeri ...

Unexpected results from the match() function

Attempting to utilize the RegExp feature in Javascript (specifically with the match function) to locate instances of a sentence and a specific word within that sentence embedded in the HTML body. Provided is some pseudo-code for reference: <!DOCTYPE ...

jQuery slideToggle function not working properly when clicking on a link within a div

I am facing a slight issue with the slideToggle function when there is a link inside the slideup panel. My goal is to create a button that, when clicked, will slide up a div displaying related posts. Subsequently, when another button or project link is cli ...

Is there a way to make jQuery Validate display errors within the form elements rather than outside of them?

Given the jQuery Validate basic example provided in the link below, what method can be used to display error messages within form elements whenever feasible (excluding checkboxes)? http://docs.jquery.com/Plugins/validation#source ...

Testing Angular Factory Injection functionality

I have come across similar issues but haven't found a solution that works for my situation. The error message Error: [ng:areq] Argument 'fn' is not a function, got undefined is causing my test to fail. How can I properly inject a factory int ...

How many controllers should be assigned to each view and what is the best way to allocate them?

Seeking feedback on controllers and views. Currently, I assign 1 controller per view, giving the controller responsibility for the entire view. However, I have learned that you can use ng-controller to assign multiple controllers to different parts of a ...

Don't forget to preserve the hover state of divs even after refreshing

I recently added a navigation bar that expands in width upon hovering over it. For an illustration, check out this example: http://jsfiddle.net/Gsj27/822/ However, I encountered an issue when clicking on a button within the hover effect area. After load ...

"Troubleshooting the Touch Functionality on Bootstrap Carousel for Mobile

Sections of my responsive website utilize a bootstrap carousel to cycle through text and images. However, during testing, it was discovered that users on iPads were unable to swipe up and down to view more content on the site. It seems that swipe compatibi ...