0
Good evening, I’m mounting the layout of a learning project of mine, I need to make the div occupy the space equal to blue image below
My code is this::
My HTML and CSS are below:
@import 'https://fonts.googleapis.com/css?family=Roboto';
.left-menu {
font-family: 'Roboto', sans-serif;
position: fixed;
top: 50px;
left: 0;
margin: 0;
padding: 0;
height: 100%;
width: 300px;
list-style-type: none;
background: #f32c52;
overflow: hidden;
transition: width .5s;
}
.left-menu:hover {
width: 300px;
}
.left-menu li {
width: 300px;
}
.left-menu li span {
font-size: 1rem;
margin: 20px 30px 0 22px;
}
.left-menu li a {
display: block;
font-size: .9rem;
text-decoration: none;
color: #FFF;
height: 60px;
}
.left-menu li a:hover {
background: #ffff;
}
.left-menu li:first-child a {
background: #14081d;
display: block;
height: 150px;
}
.up-menu {
background:#14081d;
position: fixed;
top: 0px;
left: 0;
width: 100%;
height: 50px;
color: white;
text-align: right;
}
.content {
border: solid 1px green;
color: green;
margin-top: 56px;
width: 100%;
height: 100%
}
<link rel="stylesheet" type="text/css"
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<ul class="left-menu">
<li>
<a href="#"><span class="fa fa-code"></span>Imagem</a>
</li>
<li><a href="#"><span class="fa fa-cog"></span>Menu1</a></li>
<li>
<a href="#"><span class="fa fa-font"></span>Menu2</a>
</li>
</ul>
<div class="up-menu">
up-menu
</div>
<div class="content">
div-content
</div>
I can’t make my "div-content" look like the drawing I made with the blue square because no margin or size that apply to div content works :(
Thanks sam! These posts with explanations are essential for those who are starting.
– Fernando Munhoz
Strange that in your example works, mine in Ctrl c + Ctrl v does not work
– Fernando Munhoz
So maybe there’s something else in CSS
– Sam
relates to the use of bootstrap ???
– Fernando Munhoz
Yes, of course. Bootstrap has its own grid system.
– Sam
Is there anything I can do to eliminate bootstrap and apply css?
– Fernando Munhoz
Just don’t use the bootstrap.
– Sam
The problem is that I would lose all my other styles on the other kk pages
– Fernando Munhoz
Just don’t load the bootstrap just on that page.
– Sam