Materialize SideNav fixed doesn't fit in divMake a div fill the height of the remaining screen spaceHow to horizontally center a <div>?How to make div not larger than its contents?How to align content of a div to the bottom?Creating a div element in jQueryHow to make a div 100% height of the browser window?How do I vertically align text in a div?How do I auto-resize an image to fit a div containerClick through div to underlying elementsCannot display HTML string
Has the laser at Magurele, Romania reached a tenth of the Sun's power?
C++ copy constructor called at return
Can I say "fingers" when referring to toes?
Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?
Does the Linux kernel need a file system to run?
How to preserve electronics (computers, iPads and phones) for hundreds of years
What does Apple's new App Store requirement mean
Does Doodling or Improvising on the Piano Have Any Benefits?
Biological Blimps: Propulsion
Microchip documentation does not label CAN buss pins on micro controller pinout diagram
Has any country ever had 2 former presidents in jail simultaneously?
Why is the Sun approximated as a black body at ~ 5800 K?
Make a Bowl of Alphabet Soup
PTIJ: Why is Haman obsessed with Bose?
Which Article Helped Get Rid of Technobabble in RPGs?
awk assign to multiple variables at once
When were female captains banned from Starfleet?
US tourist/student visa
How to convince somebody that he is fit for something else, but not this job?
Is there a nicer/politer/more positive alternative for "negates"?
How would you translate "more" for use as an interface button?
Non-trope happy ending?
Why is so much work done on numerical verification of the Riemann Hypothesis?
How to explain what's wrong with this application of the chain rule?
Materialize SideNav fixed doesn't fit in div
Make a div fill the height of the remaining screen spaceHow to horizontally center a <div>?How to make div not larger than its contents?How to align content of a div to the bottom?Creating a div element in jQueryHow to make a div 100% height of the browser window?How do I vertically align text in a div?How do I auto-resize an image to fit a div containerClick through div to underlying elementsCannot display HTML string
I'm trying to make a screen using CSS, DIVs and Materialize SideNav. What I'm trying to do is something like this:
This is my code:
#header
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
float:left;
width:20%;
background-color: red;
#content
float:left;
width:100%;
background-color: blue;
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";"><div><img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/></div></td>
<td style="width: 33.3%;";><div style="font-size:32px;" align="center">MAIN TITLE</div></td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
</div>
But my output it's not what I'm expecting, the SideNav does not fit in the DIV. Instead it is extending further into the header as well, furthermore, the content div has no width and the SideNav shows a scroll bar. I need to figure out what I am doing wrong.
This is my result:
html css materialize sidenav
add a comment |
I'm trying to make a screen using CSS, DIVs and Materialize SideNav. What I'm trying to do is something like this:
This is my code:
#header
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
float:left;
width:20%;
background-color: red;
#content
float:left;
width:100%;
background-color: blue;
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";"><div><img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/></div></td>
<td style="width: 33.3%;";><div style="font-size:32px;" align="center">MAIN TITLE</div></td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
</div>
But my output it's not what I'm expecting, the SideNav does not fit in the DIV. Instead it is extending further into the header as well, furthermore, the content div has no width and the SideNav shows a scroll bar. I need to figure out what I am doing wrong.
This is my result:
html css materialize sidenav
add a comment |
I'm trying to make a screen using CSS, DIVs and Materialize SideNav. What I'm trying to do is something like this:
This is my code:
#header
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
float:left;
width:20%;
background-color: red;
#content
float:left;
width:100%;
background-color: blue;
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";"><div><img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/></div></td>
<td style="width: 33.3%;";><div style="font-size:32px;" align="center">MAIN TITLE</div></td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
</div>
But my output it's not what I'm expecting, the SideNav does not fit in the DIV. Instead it is extending further into the header as well, furthermore, the content div has no width and the SideNav shows a scroll bar. I need to figure out what I am doing wrong.
This is my result:
html css materialize sidenav
I'm trying to make a screen using CSS, DIVs and Materialize SideNav. What I'm trying to do is something like this:
This is my code:
#header
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
float:left;
width:20%;
background-color: red;
#content
float:left;
width:100%;
background-color: blue;
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";"><div><img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/></div></td>
<td style="width: 33.3%;";><div style="font-size:32px;" align="center">MAIN TITLE</div></td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
</div>
But my output it's not what I'm expecting, the SideNav does not fit in the DIV. Instead it is extending further into the header as well, furthermore, the content div has no width and the SideNav shows a scroll bar. I need to figure out what I am doing wrong.
This is my result:
#header
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
float:left;
width:20%;
background-color: red;
#content
float:left;
width:100%;
background-color: blue;
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";"><div><img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/></div></td>
<td style="width: 33.3%;";><div style="font-size:32px;" align="center">MAIN TITLE</div></td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
</div>
#header
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
float:left;
width:20%;
background-color: red;
#content
float:left;
width:100%;
background-color: blue;
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";"><div><img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/></div></td>
<td style="width: 33.3%;";><div style="font-size:32px;" align="center">MAIN TITLE</div></td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li><a href="#!"><i class="material-icons">cloud</i>First Link With Icon</a></li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
</div>
html css materialize sidenav
html css materialize sidenav
edited Mar 8 at 8:43
Nitin Bisht
1,2601519
1,2601519
asked Mar 7 at 23:51
Beto RiveraBeto Rivera
33
33
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
What I tried in your code is to put absolute position in header, left-menu and the content styling (css).
See the code below
<html>
<head>
<style>
#header
left: 0;
right:0;
top: 0;
position:absolute;
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
position:absolute;
left: 0;
top:92px; bottom: 0;
width: 400px;
background-color: red;
#content
position: absolute;
left: 400px;
top:92px; right:0; bottom:0;
background-color: blue;
</style>
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";">
<div>
<img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/>
</div>
</td>
<td style="width: 33.3%;";>
<div style="font-size:32px;" align="center">MAIN TITLE</div>
</td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li>
<a href="#!">
<i class="material-icons">cloud</i>First Link With Icon</a>
</li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
<h1>Your content goes here</h1>
</div>
</body>
</html>
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054663%2fmaterialize-sidenav-fixed-doesnt-fit-in-div%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What I tried in your code is to put absolute position in header, left-menu and the content styling (css).
See the code below
<html>
<head>
<style>
#header
left: 0;
right:0;
top: 0;
position:absolute;
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
position:absolute;
left: 0;
top:92px; bottom: 0;
width: 400px;
background-color: red;
#content
position: absolute;
left: 400px;
top:92px; right:0; bottom:0;
background-color: blue;
</style>
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";">
<div>
<img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/>
</div>
</td>
<td style="width: 33.3%;";>
<div style="font-size:32px;" align="center">MAIN TITLE</div>
</td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li>
<a href="#!">
<i class="material-icons">cloud</i>First Link With Icon</a>
</li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
<h1>Your content goes here</h1>
</div>
</body>
</html>
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
add a comment |
What I tried in your code is to put absolute position in header, left-menu and the content styling (css).
See the code below
<html>
<head>
<style>
#header
left: 0;
right:0;
top: 0;
position:absolute;
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
position:absolute;
left: 0;
top:92px; bottom: 0;
width: 400px;
background-color: red;
#content
position: absolute;
left: 400px;
top:92px; right:0; bottom:0;
background-color: blue;
</style>
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";">
<div>
<img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/>
</div>
</td>
<td style="width: 33.3%;";>
<div style="font-size:32px;" align="center">MAIN TITLE</div>
</td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li>
<a href="#!">
<i class="material-icons">cloud</i>First Link With Icon</a>
</li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
<h1>Your content goes here</h1>
</div>
</body>
</html>
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
add a comment |
What I tried in your code is to put absolute position in header, left-menu and the content styling (css).
See the code below
<html>
<head>
<style>
#header
left: 0;
right:0;
top: 0;
position:absolute;
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
position:absolute;
left: 0;
top:92px; bottom: 0;
width: 400px;
background-color: red;
#content
position: absolute;
left: 400px;
top:92px; right:0; bottom:0;
background-color: blue;
</style>
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";">
<div>
<img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/>
</div>
</td>
<td style="width: 33.3%;";>
<div style="font-size:32px;" align="center">MAIN TITLE</div>
</td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li>
<a href="#!">
<i class="material-icons">cloud</i>First Link With Icon</a>
</li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
<h1>Your content goes here</h1>
</div>
</body>
</html>
What I tried in your code is to put absolute position in header, left-menu and the content styling (css).
See the code below
<html>
<head>
<style>
#header
left: 0;
right:0;
top: 0;
position:absolute;
background-color: lightgray;
width:100%;
height:10%;
text-align: center;
#left-menu
position:absolute;
left: 0;
top:92px; bottom: 0;
width: 400px;
background-color: red;
#content
position: absolute;
left: 400px;
top:92px; right:0; bottom:0;
background-color: blue;
</style>
</head>
<body>
<div id="header">
<table>
<tr>
<td style="width: 33.3%";">
<div>
<img src="img/main_logo.png" width="300px" height="60" style="vertical-align: middle"/>
</div>
</td>
<td style="width: 33.3%;";>
<div style="font-size:32px;" align="center">MAIN TITLE</div>
</td>
<td style="width: 33.3%";></td>
</tr>
</table>
</div>
<div id="left-menu">
<ul id="slide-out" class="side-nav fixed">
<li>
<div class="userView">
<img class="background" src="http://placehold.it/350x150">
<a href="#!user"><img class="circle" src="http://placehold.it/350x300"></a>
<a href="#!name"><span class="white-text name">John Doe</span></a>
<a href="#!email"><span class="white-text email">jdandturk@gmail.com</span></a>
</div>
</li>
<li>
<a href="#!">
<i class="material-icons">cloud</i>First Link With Icon</a>
</li>
<li><a href="#!">Second Link</a></li>
<li><div class="divider"></div></li>
<li><a class="subheader">Subheader</a></li>
<li><a class="waves-effect" href="#!">Third Link With Waves</a></li>
</ul>
</div>
<div id="content">
<h1>Your content goes here</h1>
</div>
</body>
</html>
answered Mar 8 at 9:19
afikriafikri
10417
10417
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
add a comment |
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
It's not working, the menu it's outside the DIV imgur.com/0keLB0a
– Beto Rivera
Mar 8 at 15:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55054663%2fmaterialize-sidenav-fixed-doesnt-fit-in-div%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown