Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Administrator
m4lab_landing_page
Commits
0c2f42a3
Commit
0c2f42a3
authored
4 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
MLAB-229: sticky footer
parent
38cfc0bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/headfoot.html
+20
-3
includes/headfoot.html
js/headfoot.js
+23
-1
js/headfoot.js
with
43 additions
and
4 deletions
+43
-4
includes/headfoot.html
+
20
-
3
View file @
0c2f42a3
...
...
@@ -12,6 +12,23 @@
<link
rel=
"stylesheet"
href=
"../fonts/ionicons.min.css"
>
<link
rel=
"stylesheet"
href=
"../css/Testimonials.css"
>
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity=
"sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay"
crossorigin=
"anonymous"
>
<style>
@media
only
screen
and
(
min-width
:
768px
)
{
html
{
position
:
relative
;
min-height
:
100%
;
}
body
{
margin-bottom
:
120px
;
/* Margin bottom by footer height */
}
#homepage
{
position
:
absolute
;
bottom
:
0
;
width
:
100%
;
text-align
:
center
;
}
}
</style>
</head>
<body>
...
...
@@ -124,7 +141,7 @@
<p>
test test test test 123
</p>
<p>
test test test test
</p>
<p>
test test test test
</p>
<p>
test test test test
</p>
<
!--
p> test test test test</p>
<hr>
<p> test test test test</p>
<p> test test test test</p>
...
...
@@ -136,12 +153,12 @@
<p> test test test test</p>
<p> test test test test</p>
<p> test test test test</p>
<p>
test test test test
</p>
<p> test test test test</p
--
>
<hr>
</div>
<!-- footerdiv -->
<div
id=
"homepage"
class=
"last clear"
>
<div
id=
"homepage"
>
<hr>
<!-- containerdiv -->
<div
class=
"container"
>
...
...
This diff is collapsed.
Click to expand it.
js/headfoot.js
+
23
-
1
View file @
0c2f42a3
...
...
@@ -140,9 +140,31 @@ function head() {
*/
function
foot
()
{
// add styles to <head> to manage sticky footer
var
styles
=
`
@media only screen and (min-width: 768px) {
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 120px; /* Margin bottom by footer height */
}
#homepage {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
}
}
`
var
styleSheet
=
document
.
createElement
(
"
style
"
)
styleSheet
.
type
=
"
text/css
"
styleSheet
.
innerText
=
styles
document
.
head
.
appendChild
(
styleSheet
)
let
footerdiv
=
document
.
createElement
(
'
div
'
);
footerdiv
.
id
=
"
homepage
"
;
footerdiv
.
classList
.
add
(
"
last
"
,
"
clear
"
);
footerdiv
.
innerHTML
=
"
<hr>
"
;
let
containerdiv
=
document
.
createElement
(
'
div
'
);
containerdiv
.
classList
.
add
(
'
container
'
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment