I'm having a problem with trying to create a footer in an angular4 app. The issue seems to be if a child component loaded in the app-router is of greater height than it's parent component... The footer on the parent doesn't go to the bottom of the full page, but just to the bottom of the parent component.
eg.
I've placed my footer at the very bottom of the app.component.html file:
<div class="contain">
<div id="splashbackground">
<div class="dark-overlay">
<app-header></app-header>
<div class="container mt-5">
<router-outlet></router-outlet>
</div>
</div>
</div>
</div>
<app-footer></app-footer>
The footer is a very simple element:
<footer style="height:150px; background-color:blue">
<h3 class="text-light mt-5">This is the app footer</h3>
</footer>
The problem is the footer doesn't go to the bottom of the total app, it goes to the bottom of the app.component.html...but if the child component being loaded in the app-router is large ie the result of an ngFor loop of many elements... then it the footer is no longer underneath the child.
I can demonstrate the problem more simply by this:
I add a simple component of height 3000px and bootstrap background color danger orange:
<div class="bg-danger" style="height: 3000px;">
</div>
I load the component via routes to go into the router outlet.
The result is this:
Image of problem
How can I make sure the footer is at the bottom of the page?
EDIT:
This CSS is attached to the .css file in the app component.
None of the others seem to address the issue:
#splashbackground{
background:url('/assets/images/photo.jpg') no-repeat;
background-size:cover;
min-height:950px;
}
.dark-overlay{
background-color:rgba(0,0,0,0.4);
position:absolute;
top:0;
left:0;
width:100%;
min-height:952px;
}
Outside attached to other .css files there's these, but none of them really deal with positioning of the card elements or anything. What can I add to the footer element to ensure it will be at the bottom?
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
.clickable{
cursor: pointer;
}
.borderThin{
border: 1px gray inset;
border-radius: 15px;
}
.vertical-align {
position:relative;
top:50%;
}
.card-img-left {
border-bottom-left-radius: calc(.25rem - 1px);
border-top-left-radius: calc(.25rem - 1px);
float: left;
padding-right: 1em;
margin-bottom: -1.25em;
}
.panelTheme {
background-color: #222;
color:#999;
border-radius: 5px;
}
/*Image Insertion*/
.customClass {
background-color: #222;
border-radius: 5px;
margin:5px;
width: 500px;
}
.customClass .img-ul-upload {
background-color: #222 !important;
}
.customClass .img-ul-clear {
background-color: #222 !important;
}
.customClass .img-ul-drag-box-msg {
color: purple !important;
}
.customClass .img-ul-container {
background-color: #222 !important;
}
/*Image Insertion*/
/* Ensure that all of the zero offsets are available - recent SASS version did not include .col-sm-offset-0 */
#media (min-width: 768px) {
.col-sm-offset-0,
.col-md-offset-0,
.col-lg-offset-0 {
margin-left: 0;
}
}
.modal-content{
background-color: #222;
border-color: #222;
border-radius: 0;
}
.modal-header{
border-bottom: 0px !important;
}
.modal-backdrop{
background-color: red;
}
.customClass {
background-color: #D21C1C;
border-radius: 5px;
margin:auto;
width: 50%;
}
.customClass .img-ul-upload {
background-color: #222 !important;
}
.customClass .img-ul-clear {
background-color: #222 !important;
}
.customClass .img-ul-drag-box-msg {
color: purple !important;
}
.customClass .img-ul-container {
background-color: #222 !important;
}
Solved!
The issue seems to have been how the divs were organised in the app-component.html:
Going from:
<div class="contain">
<div id="splashbackground">
<div class="dark-overlay">
<app-header></app-header>
<div class="container mt-5">
<router-outlet></router-outlet>
</div>
</div>
</div>
</div>
<app-footer></app-footer>
to this:
<div id="splashbackground">
<div class="dark-overlay">
<app-header></app-header>
<div class="container mt-5">
<router-outlet></router-outlet>
</div>
<app-footer></app-footer>
</div>
</div>
fixed the issue.
Related
I have 2 div<> that I would like to be next to eachother. They are inside of a form<>. The one I have on the left won't float all the way up. It seems that my First Div keeps blocking it. I have resized it multiple times and It still doesn't work. Here is my Css code and as you can see there is not much to it. I also have no inline styling. My first Div is called ContactInput and my second Div is called invisible
#body {
border: 1px double black;
}
#checkout { //this is just a head at the top
text-align:left;
border-bottom: 1px solid black;
}
#contactInput{
clear:right;
padding:.5em;
}
#invisible{
float:right;
padding:.5em;
}
Like this?
#contact {
width: 50%;
padding:.5em;
background: blue;
float: left;
box-sizing: border-box;
}
#invisible {
width: 50%;
padding:.5em;
background: red;
float: left;
box-sizing: border-box;
}
<div id="contact">
</div>
<div id="invisible">
</div>
I recommend flex instead of float
.wrap {
display: flex;
}
#contact {
flex: 1;
padding:.5em;
background: blue;
}
#invisible {
flex: 1;
padding:.5em;
background: red;
}
<div class="wrap">
<div id="contact">
</div>
<div id="invisible">
</div>
</div>
I have two form elements one is vertical-dot-navigation (https://github.com/Robaum/Vertical-Dot-Navigation/commit/128bfe1c236139184). I'd like to locate it side by side with a form element <div>.
I arrange in html as
<body>
<form class="summarybackground" name="summary" id="summary" style="height:550px;width:920px;overflow-y:auto;" method="post">
<div class="myBox" id="section">
<div class="dotstyle dotstyle-scaleup">
<ul>
<li class="current">section1</li>
<li>section2</li>
<li>section3</li>
<li>section4</li>
<li>section5</li>
</ul>
</div>
<div class="col-sm-9">
<div id="section1">
<h1>Landed</h1>
</div>
<div id="section2">
<h1>Apartment</h1>
</div>
<div id="section3">
<h1>Condominium</h1>
</div>
<div id="section4">
<h1>Commercial</h1>
</div>
<div id="section5">
<h1>Farm</h1>
</div>
</div>
</form>
</body>
It is shown in the attached picture .
The problem is they are not arranged as side by side.
The CSS code is shown below and component.css for vertical-dot-navigation is here.
/*This is for summary view*/
.summarybackground {background-color:#3E3947;}
.myBox {
border: none;
padding: 5px;
font: 24px/36px sans-serif;
width: 800px;
height: 500px;
margin-bottom: 150%;
}
/* Scrollbar styles */
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-track {
border: 1px solid yellowgreen;
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background: yellowgreen;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #88ba1c;
}
div.col-sm-9 div {
height: 500px;
font-size: 28px;
}
#section1 {color: #fff; background-color: #1E88E5;}
#section2 {color: #fff; background-color: #673ab7;}
#section3 {color: #fff; background-color: #ff9800;}
#section4 {color: #fff; background-color: #00bcd4;}
#section5 {color: #fff; background-color: #009688;}
/*This is for summary view*/
Maybe trying to put an absolute position on the dotstyle class
.dotstyle{
position:absolute;
right:10px;
top:100px
}
you can float vertical-dot-navigation to right.
.dotstyle {
float:right
}
Hope this will solve your problem, if you still have problem please share working demo on jsfiddle.
you have div class .dotstyle have no float defined
if you want to make it right set your css class as below:
.dotstyle{
float:right
}
HTML
<paper-card class="media-responsive" heading="Nearest customers">
<div class="card-content">
<nearest-customers id="nearestCustomers" card-view-max-records="3"></nearest-customers>
</div>
<div class="card-actions card-footer">
<div style="float:right;text-align:right">
<a data-route="allcustomers" href="/full-customer-list">Full customer list
<iron-icon class="iron-icon-12" icon="fa:arrow-right"></iron-icon></a>
</div>
<div class="clear"></div>
</div>
</paper-card>
CSS:
<style type="text/css">
paper-card {
position: relative !important;
width: 100%;
margin-bottom: 10px;
height: auto !important;
}
.card-actions {
position: relative !important;
bottom: 0 !important;
}
</style>
Custom Style:
<style is="custom-style">
paper-card {
--paper-card-header-color: #000000;
--paper-card-header-text:{
font-size:15px;
margin:0 auto;
};
--paper-card-header: {
margin:0 auto;
border-bottom:1px solid #dddddd !important;
padding:0;
margin-bottom:0px !important;
};
--paper-card-actions {
border-top: 1px solid #e8e8e8;
padding: 5px 16px;
position:relative !important;
#apply(--paper-card-actions);
}
}
</style>
Output (please see attached image)
How can I achieve this?
I have solved this in the past by using iron-flex-layout.
You could also solve it using the --paper-card-actions and defining the proper flex styles.
Also I think for your custom style example there is a typo:
--paper-card-actions { should be --paper-card-actions: {
how can I create menu like on the picture?
Requirements:
Built using Bootstrap columns, must be responsive
In normal state, only Option and icon (green square) can be seen
OnHover: The Suboption (in blue rectangle) expands pushing Option up and also Caption in red rectangle appears, also pushing the whole Option up.
When one Menu item is hovered, all the others must stay down, not moving
Expanding with animation
Here's my fiddle attempt: http://jsfiddle.net/52VtD/7878/
HTML of one item (all are wrapped in a row):
<div class="col-xs-12 col-sm-3 nopadding item">
<div class="mask">
<div class="inner-wrapper">
<p>Option A</p>
<div class="hidding-guy">
<p>Hello</p>
Suboption
Suboption
Suboption
</div>
<i class="origami o-01"></i>
</div>
<div class="btn-red ">CAPTION</div>
</div>
</div>
CSS:
.nopadding {
padding: 0 !important;
margin: 0 !important;
}
.footer-menu-wrapper {
background: #ddd;
position: fixed;
bottom: 0;
width: 100%;
margin: 0;
}
.footer-menu-wrapper .item {
position: relative;
}
.footer-menu-wrapper .item:hover .hidding-guy, .footer-menu-wrapper .item:hover .hidding-guy > * {
height: auto;
}
.footer-menu-wrapper .mask {
border: 1px solid #ccc;
width: 100%;
}
.footer-menu-wrapper .mask .hidding-guy {
height: 0px;
}
.footer-menu-wrapper .mask .hidding-guy > * {
display: block;
height: 0px;
}
.btn-red {
background: #e91333;
color: #fff;
width: 100%;
min-height: 66px;
border: 0px transparent;
text-align: center;
}
Alter your css to:
.footer-menu-wrapper .mask {
border: 1px solid #ccc;
width: 100%;
position: absolute;
background-color: #ddd;
bottom: 0;
}
now it behave like a dropup menu. Keep in mind that you must reset the positioning for the responsive layout like:
#media (max-width: 768px){
.footer-menu-wrapper .mask{
position: relative;
}
}
DEMO
UPDATE DEMO with media query
UPDATE:
Hide the CAPTION - opacity: 0 and show it on hover.
Second hide the options - visibilety: hidden and also show it on hover.
This ist a quick solution! The rest should be simple css styling
DEMO
Was wondering if i can display 1 text box and 3 images on the same row? All the images are the same size. If possible aswell i'd ideally like a some text underneath each image aswell?
heres the code:
<div class="row">
<div class="side-bar">
<h3> Recent Work </h3>
<p>Here's some of my latest work, covering web design, branding and identity.</p>
View the Portfolio →
</div>
<div class="recent-wrap">
<img src="img/body-metrix.png">
<img src="img/body-metrix-logo.png">
<img src="img/market.png">
</div>
</div>
.row {
display: inline;
float: left;
}
.side-bar {
padding: 10px;
background-color: #f3f3f3;
height: 200px;
width: 250px;
}
.side-bar h3 {
font-weight: bold;
font-size: 19px;
margin-bottom: 5px;
}
.side-bar p {
font-size: 14px;
}
.side-bar a {
font-size: 13px;
}
.recent-wrap img {
max-width: 225px;
min-height: 125px;
border-style: solid;
border-width: 1px;
border-color: #000000;
margin-right: 20px;
margin-bottom: 20px;
}
Ive searched the internet but no luck as yet.
thanks in advance.
There are a number of ways to do this, one example is to float the two child elements:
.side-bar, .recent-wrap {
float: left;
}
This will only work if there is enough room on the parent element for the .side-bar and .recent-wrap to sit next to each other.
Example: http://jsbin.com/poxox/1/edit
CSS:
.row {
width: 250px
}
http://jsfiddle.net/3DCSd/
Here Is a working Fiddle
.row {
display: inline-block; /* changed to inline-block, you don't need
inline and float */
}
.recent-wrap a { /*changed to a , since your images are wrapped in <a> */
max-width: 225px;
min-height: 125px;
border-style: solid;
border-width: 1px;
border-color: #000000;
margin-right: 20px;
margin-bottom: 20px;
}
The rest of the CSS stayed the same
and HTML I just added the text box
<div class="row">
<div class="side-bar">
<h3> Recent Work </h3>
<p>Here's some of my latest work, covering web design, branding and identity.</p>
View the Portfolio →
</div>
<div class="recent-wrap">
<input type="text" id="ss" />
<img src="img/body-metrix.png"/>
<img src="img/body-metrix-logo.png"/>
<img src="img/market.png"/>
</div>
</div>
Try this:
.side-bar {
padding: 10px;
background-color: #f3f3f3;
height: 200px;
width: 250px;
float: left; /* added */
}
.recent-wrap {
margin-left: 270px; /* added (padding + width) of side-bar */
}
Working Fiddle
This approach let the second container stay in line with the first container even if the window size is small.
Here is the sample with textboxes below image: example