Implement Navigation from Cody House-Way to add background blur? - html

I'm basically implementing this navigation from Cody House. For smaller screens <1000px, is there a way to have the nav .cd-morph-dropdown .morph-dropdown-wrapper have a width of 90% (instead of 100%) and have the background behind the nav blur? Basically have the area around the nav overlay to be blurred and have nav be clear.
Would the way around it be to apply the filter: blur(10px) to every div following the navigation via jquery? There has got to be a better approach.
NAV HTML
<nav class="main-nav">
<ul>
<li class="has-dropdown gallery" data-content="about">
About
</li>
<li class="has-dropdown links" data-content="pricing">
Pricing
</li>
<li class="has-dropdown button" data-content="contact">
Contact
</li>
</ul>
</nav>
<div class="morph-dropdown-wrapper">
<div class="dropdown-list">
<ul>
<li id="about" class="dropdown gallery">
About
<div class="content">
<ul>
<li>
<a href="#0">
<em>Title here</em>
<span>A brief description here</span>
</a>
</li>
<li>
<a href="#0">
<em>Title here</em>
<span>A brief description here</span>
</a>
</li>
<li>
<a href="#0">
<em>Title here</em>
<span>A brief description here</span>
</a>
</li>
<li>
<a href="#0">
<em>Title here</em>
<span>A brief description here</span>
</a>
</li>
</ul>
</div>
</li>
<li id="pricing" class="dropdown links">
Pricing
<div class="content">
<ul>
<li>
<h2>Services</h2>
<ul class="links-list">
<li>Logo Design</li>
<li>Branding</li>
<li>Web Design</li>
<li>iOS</li>
<li>Android</li>
<li>HTML/CSS/JS</li>
<li>Packaging</li>
<li>Mobile</li>
<li>UI/UX</li>
<li>Prototyping</li>
</ul>
</li>
<li>
<h2>Projects</h2>
<ul class="links-list">
<li>Logo Design</li>
<li>Branding</li>
<li>Web Design</li>
<li>iOS</li>
<li>Android</li>
<li>HTML/CSS/JS</li>
</ul>
</li>
</ul>
</div>
</li>
<li id="contact" class="dropdown button">
Contact
<div class="content">
<ul class="links-list">
<li>Link #1</li>
<li>Link #2</li>
<li>Link #3</li>
<li>Link #4</li>
<li>Link #5</li>
<li>Link #6</li>
</ul>
Get in Touch
</div>
</li>
</ul>
<div class="bg-layer" aria-hidden="true"></div>
</div> <!-- dropdown-list -->
</div> <!-- morph-dropdown-wrapper -->
</header>
<main class="cd-main-content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ultrices malesuada scelerisque. Vivamus placerat dignissim eros ut sollicitudin. Suspendisse potenti. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse ut tellus euismod, sagittis enim eu, luctus tortor. Cras eros urna, maximus et arcu et, vehicula auctor erat. Aliquam laoreet dui eu magna mollis ornare ut in lectus. Proin nec sapien leo. Phasellus rhoncus risus sit amet mi tempus dignissim. Ut dictum faucibus ipsum, congue aliquet mauris laoreet vel. Suspendisse ultricies, libero a ullamcorper volutpat, erat nunc sagittis tellus, sit amet bibendum diam mi sed justo. Integer ac ex a felis pretium malesuada et condimentum nunc. Proin vitae mauris ex. Quisque consectetur metus et sagittis fringilla. Morbi pretium libero sed enim scelerisque, accumsan venenatis ex consectetur.</p>
</main>
Edit: added a codepen here.

Related

Bootstrap columns and justify-content-end

I'm having difficulty getting my columns to spread out.
According to the docs (https://getbootstrap.com/docs/5.0/layout/columns/#horizontal-alignment), justify-content-between should be what I need.
But I end up with my columns in their default position, not pushed outwards.
Basic code example:
https://codepen.io/6a0a49af-a3f9-4e78-8ccf-91d8d1b1f102/pen/QWKYJqM
I have changed your code a little to get the desired effect.
On <div class="row"> i removed some unneeded styles.
and on the <div class="col"> i changed it to col-4 to set the width.
Since bootstrap works in a frame of 12. 4 + 4 leaves 4 short so thats the space thats being filled with justify-content-between.
I also deleted your css since it was not needed.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<body class="d-flex flex-column min-vh-100">
<!-- -->
<nav class="navbar navbar-light navbar-expand-md bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="img/logo.svg" alt="">
</a>
<!-- -->
<div class="navbar-nav d-none d-md-flex">
<a class="nav-link active" aria-current="page" href="#">Home</a>
<a class="nav-link" href="#">A</a>
<a class="nav-link" href="#">B</a>
<a class="nav-link" href="#">C</a>
<a class="nav-link" href="#">D</a>
<a class="nav-link" href="#">E</a>
</div>
<!-- -->
<span>
<a href="https://twitter.com/" rel="nofollow noopener noreferrer"><i
class="fab fa-twitter mx-2 gstwitterblue"></i></a>
<a href="https://www.linkedin.com/"
rel="nofollow noopener noreferrer"><i class="fab fa-linkedin mx-2 gslinkedinblue"></i></a>
</span>
</div>
</nav>
<main class="flex-fill">
<div class="container d-none d-md-flex flex-md-row">
<div class="row justify-content-between">
<div class="col-4">
<div class="card">
<div class="ratio ratio-16x9">
<iframe src="https://www.youtube-nocookie.com/embed/wm48_VrbB4Q?rel=0" allowfullscreen></iframe>
</div>
<div class="card-body">
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam efficitur orci malesuada sem lacinia, vitae tempor tellus auctor. Sed elementum iaculis quam ac consectetur. Nam ac laoreet est, ut placerat arcu. Ut viverra, quam vitae gravida ornare, arcu felis elementum elit, a pulvinar lacus augue ac nisl. Nunc tincidunt ultricies luctus. Donec et congue ex. Curabitur lacinia scelerisque imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean ultricies, mauris at ultricies dapibus, urna nisl ullamcorper libero, ac dictum ex neque sed ante. Pellentesque luctus nibh libero, consequat vulputate eros porttitor vitae.</p>
</div>
</div>
</div>
<div class="col-4">
<div class="card gscustomwidth">
<div class="ratio ratio-16x9">
<iframe src="https://www.youtube-nocookie.com/embed/wm48_VrbB4Q?rel=0" allowfullscreen></iframe>
</div>
<div class="card-body">
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam efficitur orci malesuada sem lacinia, vitae tempor tellus auctor. Sed elementum iaculis quam ac consectetur. Nam ac laoreet est, ut placerat arcu. Ut viverra, quam vitae gravida ornare, arcu felis elementum elit, a pulvinar lacus augue ac nisl. Nunc tincidunt ultricies luctus. Donec et congue ex. Curabitur lacinia scelerisque imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean ultricies, mauris at ultricies dapibus, urna nisl ullamcorper libero, ac dictum ex neque sed ante. Pellentesque luctus nibh libero, consequat vulputate eros porttitor vitae. </p>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Standard Footer -->
<footer class="bg-light py-3 d-none d-md-flex">
<div class="container d-flex justify-content-between">
<span class="text-dark fw-lighter">Copyright © 2020 Foobar Ltd. All rights reserved.</span>
<span class="text-dark fw-lighter"><a href="#" class="text-reset text-decoration-none">Legal
Information</a></span>
</div>
</footer>
</body>
The reason what you want doesn't happen is because you're not giving the row div a full width. From your code, add w-100 to the following div:
<div class="row row-cols-1 row-cols-md-2 justify-content-between">

Why is my button not jumping to its intended section in Bootstrap 4?

I have a question regarding using scrollspy, adding a button inside the navbar, and having that button jump to its intended target section. I added a tag to be more semantic, and used a with the class of form-inline to put it next to the navbar links. The nav links work fine, but the button doesn't.
I was trying different ways to add the href to the button tag, or to substitute the tag with an tag and removing the tag, but nothing works. I was trying to find a scrollspy that used the tag, but no luck. Here's my code:
<body data-spy="scroll" data-target="#navbar">
<nav class="navbar fixed-top navbar-expand-md navbar-dark" id="navbar">
<a class="navbar-brand" href="index.html" id="navbarBrand">Unexpected Friends</a>
<!--navbar toggler is the hamburger icon that appears when in smaller screens-->
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbarNav" class="collapse navbar-collapse">
<!--ml-auto moves the links to the right-->
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#ourStory">Our Story<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#gallery">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#blog">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
<form class="form-inline" id="button">
<button type="button" class="btn btn-outline-light" role="button" id="waysToHelp" href="#waysToHelp">Ways to Help</button>
</form>
</ul>
</div><!--navbarNav-->
</nav>
<section id="waysToHelp">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<img src="img/uf_10.jpg" class="img-fluid float-right ml-4">
<h1 class="text-center">Ways To Help</h1>
<p>Pretium vulputate sapien nec sagittis aliquam malesuada bibendum arcu. Lacinia quis vel eros donec ac. Arcu cursus vitae congue mauris rhoncus aenean vel elit scelerisque. Faucibus turpis in eu mi bibendum. Massa ultricies mi quis hendrerit. Bibendum ut tristique et egestas quis. Nisi vitae suscipit tellus mauris a. Lobortis feugiat vivamus at augue eget. Placerat vestibulum lectus mauris ultrices eros in cursus turpis massa. Pellentesque elit ullamcorper dignissim cras. Pellentesque sit amet porttitor eget dolor morbi non arcu risus. Tellus id interdum velit laoreet id donec ultrices tincidunt. Et egestas quis ipsum suspendisse ultrices gravida dictum fusce. Adipiscing diam donec adipiscing tristique risus. Mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor. Dictum sit amet justo donec enim diam. Porttitor lacus luctus accumsan tortor posuere ac ut consequat. Ultricies tristique nulla aliquet enim.<br><br>
Congue nisi vitae suscipit tellus mauris a diam maecenas sed. Risus in hendrerit gravida rutrum quisque. Tristique et egestas quis ipsum suspendisse ultrices gravida dictum. Ipsum consequat nisl vel pretium lectus quam id. Ut sem viverra aliquet eget sit amet. Sed euismod nisi porta lorem mollis aliquam ut porttitor leo. Semper quis lectus nulla at volutpat diam ut. Risus at ultrices mi tempus. Eu feugiat pretium nibh ipsum consequat nisl. Eu scelerisque felis imperdiet proin fermentum. Lorem sed risus ultricies tristique nulla aliquet enim tortor at. Sit amet mauris commodo quis imperdiet massa. Urna porttitor rhoncus dolor purus. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit.</p>
</div><!--column-->
</div><!--row-->
</div><!--container-->
</section>
</body>
Kindly read the documentation properly :
The data-spy attribute will be on the div outside the the nav with a data-target to indicate the selected nav
It has to be a tag because of href. It converts hash url,which is also accessible when entered in the url directly. That is the fundamentals of how it works.
You can do it like -
<button type="button" class="btn btn-outline-light" role="button"
id="waysToHelp">ways to help</button>
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#ourStory">Our Story<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#gallery">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#blog">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#waysToHelp">ways to help</a>
</li>
<form class="form-inline" id="button">
<button type="button" class="btn btn-outline-light" role="button" id="waysToHelp">ways to help</button>
</form>
</ul>
Example - https://jsfiddle.net/cvwrfau0/

Using materialize, wanting to eliminate white space margin on mobile-only

enter image description hereI am using materialize framework for building my first basic site, however on mobile only view, the margins are quite wide and i'd like them to take up full screen, so as to make reading better and make the middle card stretch less.
I have also attached a picture now, as you can see the padding and margins are quite wide.
https://codepen.io/jehc10/pen/LKqRRQ
.brand-logo {
margin-left: 20px;
}
.card {
margin-top: 15px;
}
body {
display: flex;
min-height: 100vh;
flex-direction: column;
font-family: 'ABeeZee', sans-serif;
background: #fad1df;
}
main {
flex: 1 0 auto;
}
.custom {
margin-right: 100px;
margin-left: 100px;
}
.pagination {
margin-top: 25px;
display: flex;
align-items: center;
justify-content: center;
}
table {
width: 600px;
margin: auto;
border: 2px solid #f1749e;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My materialize website</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link rel="stylesheet" href="materialize.css">
<link href="https://fonts.googleapis.com/css?family=ABeeZee&display=swap" rel="stylesheet">
</head>
<body>
<!-- Navbar -->
<main>
<nav>
<div class="nav-wrapper pink lighten-3">
Website
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>Sass</li>
<li>Components</li>
<li>JavaScript</li>
</ul>
</div>
</nav>
<!-- Cards -->
<div class="row">
<div class="col s12 m6">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">Example 1</span>
<p>I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
Request a quote
</div>
</div>
</div>
<div class="col s12 m6">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">Example 2</span>
<p>I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
Request a quote
</div>
</div>
</div>
</div>
<!-- Middle card -->
<div class="mobile-margin visible-xs">
<div class="lg12">
<div class="card custom light-blue lighten-5">
<div class="card-content black-text">
<span class="card-title">Example 1</span>
<p>
Mauris accumsan pretium lorem et pretium. In lectus metus, tincidunt a ante nec, porta pretium diam. Integer dolor justo, porta nec scelerisque eget, consequat vel mauris. Curabitur quis ipsum magna. Nullam eu dolor id risus convallis pulvinar sed id
risus. Aliquam condimentum ullamcorper suscipit. Cras vel ligula sit amet tellus hendrerit tincidunt. Proin nec augue id diam fermentum semper dapibus eleifend diam. Quisque vel urna in ante euismod maximus at sed est. Quisque ut tincidunt
sapien. Suspendisse ut tempus augue. Cras feugiat elementum lorem, vel pellentesque magna. Mauris accumsan pretium lorem et pretium. In lectus metus, tincidunt a ante nec, porta pretium diam. Integer dolor justo, porta nec scelerisque eget,
consequat vel mauris. Curabitur quis ipsum magna. Nullam eu dolor id risus convallis pulvinar sed id risus. Aliquam condimentum ullamcorper suscipit. Cras vel ligula sit amet tellus hendrerit tincidunt. Proin nec augue id diam fermentum
semper dapibus eleifend diam. Quisque vel urna in ante euismod maximus at sed est. Quisque ut tincidunt sapien. Suspendisse ut tempus augue. Cras feugiat elementum lorem, vel pellentesque magna. Mauris accumsan pretium lorem et pretium.
In lectus metus, tincidunt a ante nec, porta pretium diam. Integer dolor justo, porta nec scelerisque eget, consequat vel mauris. Curabitur quis ipsum magna. Nullam eu dolor id risus convallis pulvinar sed id risus. Aliquam condimentum ullamcorper
suscipit. Cras vel ligula sit amet tellus hendrerit tincidunt. Proin nec augue id diam fermentum semper dapibus eleifend diam. Quisque vel urna in ante euismod maximus at sed est. Quisque ut tincidunt sapien. Suspendisse ut tempus augue.
Cras feugiat elementum lorem, vel pellentesque magna. Mauris accumsan pretium lorem et pretium. In lectus metus, tincidunt a ante nec, porta pretium diam. Integer dolor justo, porta nec scelerisque eget, consequat vel mauris. Curabitur quis
ipsum magna. Nullam eu dolor id risus convallis pulvinar sed id risus. Aliquam condimentum ullamcorper suscipit. Cras vel ligula sit amet tellus hendrerit tincidunt. Proin nec augue id diam fermentum semper dapibus eleifend diam. Quisque
vel urna in ante euismod maximus at sed est. Quisque ut tincidunt sapien. Suspendisse ut tempus augue. Cras feugiat elementum lorem, vel pellentesque magna.
</p>
</div>
</div>
</div>
<!-- Table -->
<table class="responsive-table">
<thead>
<tr>
<th>Name</th>
<th>Item Name</th>
<th>Item Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alvin</td>
<td>Eclair</td>
<td>$0.87</td>
</tr>
<tr>
<td>Alan</td>
<td>Jellybean</td>
<td>$3.76</td>
</tr>
<tr>
<td>Jonathan</td>
<td>Lollipop</td>
<td>$7.00</td>
</tr>
</tbody>
</table>
<!-- Hover button -->
<div class="fixed-action-btn">
<a class="btn-floating btn-large red">
<i class="large material-icons">mode_edit</i>
</a>
<ul>
<li><a class="btn-floating red"><i class="material-icons">insert_chart</i></a></li>
<li><a class="btn-floating yellow darken-1"><i class="material-icons">format_quote</i></a></li>
<li><a class="btn-floating green"><i class="material-icons">publish</i></a></li>
<li><a class="btn-floating blue"><i class="material-icons">attach_file</i></a></li>
</ul>
</div>
<!-- Pagination -->
<ul class="pagination">
<li class="disabled"><i class="material-icons">chevron_left</i></li>
<li class="active">1</li>
<li class="waves-effect">2</li>
<li class="waves-effect">3</li>
<li class="waves-effect">4</li>
<li class="waves-effect">5</li>
<li class="waves-effect"><i class="material-icons">chevron_right</i></li>
</ul>
</main>
<!-- Footer -->
<footer class="page-footer pink lighten-3">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Footer Content</h5>
<p class="grey-text text-lighten-4">You can use rows and columns here to organize your footer content.</p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Link 1</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 2</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 3</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Link 4</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2019 Jesse
<a class="grey-text text-lighten-4 right" href="#!">More Links</a>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script src="js/init.js"></script>
</body>
</html>

Full screen a part of page

I have a html code like this:
<header>title</header>
<content class="container-fluid">
<div class="row">
<div class="col-sm-3 leftside">
<ul>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
</div>
<div class="col-sm-9">
<div id="map"></div>
</div>
</div>
</content>
<footer>footer</footer>
I want show the content section of code in one monitor screen.
google map must be full screen (and responsive).
and also side menu must be full screen (for more rows, It must use scroll in it's columns)
how can I do it?
demo code sample
EDIT:
when I open the page by brower, I could see the header and the content (in full screen) and with scroll I can see the footer section.
Here you go... see snippet below. Also here https://jsfiddle.net/darrendiscovr/s1vp1348/ and without Google maps API error.
5 minutes reading the bootstrap docs https://getbootstrap.com/ will get you on the right track and makes learning their components a breeze.
var settingsItemsMap = {
zoom: 12,
center: new google.maps.LatLng(40.768516981, -73.96927308),
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map'), settingsItemsMap);
var myMarker = new google.maps.Marker({
position: new google.maps.LatLng(40.768516981, -73.96927308),
draggable: true
});
map.setCenter(myMarker.position);
myMarker.setMap(map);
nav {
background: red;
color: #fff;
}
.sidebar {
position: fixed;
top: 51px;
bottom: 0;
left: 0;
z-index: 1000;
padding: 20px 0;
overflow-x: hidden;
overflow-y: auto;
border-right: 1px solid #eee;
background: lightblue;
}
main.col-sm-9.ml-sm-auto.col-md-10 {
padding: 0;
}
section.content {
padding: 2em;
height: 100vh;
}
#map {
height: 100vh;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js"></script>
<header>
<nav class="navbar fixed-top">
<a class="navbar-brand">
Title
</a>
</nav>
</header>
<div class="container-fluid">
<div class="row">
<nav class="col-sm-3 col-md-2 sidebar">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Menu 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Menu 2</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Menu 3</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">...</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Menu Last</a>
</li>
</ul>
</nav>
<main role="main" class="col-sm-9 ml-sm-auto col-md-10">
<section class="content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ante quam, accumsan vitae augue ut, pharetra placerat ligula. Nam sed lorem augue. Donec ipsum velit, mattis sit amet nibh eu, ultrices porta nulla. In dictum ex ligula, eu efficitur metus
pretium et. Aliquam convallis dictum justo in imperdiet. Praesent tincidunt orci et fringilla consequat. Fusce convallis, dolor in mollis gravida, leo risus hendrerit magna, id sagittis nisl tellus quis ex. Mauris rutrum aliquam eleifend. Nullam
dignissim dictum rutrum. Nam tristique mattis nunc nec pretium. Ut at maximus nibh. Donec vel semper sapien, eget semper neque. Maecenas felis magna, condimentum ac ipsum vitae, auctor egestas massa. Nunc vulputate accumsan sem et vehicula.
Nulla ac lorem congue tortor pharetra feugiat. Curabitur lacinia, nisl quis vestibulum convallis, lorem lectus bibendum elit, sed finibus sapien tortor a orci.
</p>
</section>
<section>
<div id="map"></div>
</section>
</main>
</div>
</div>

clear both and divs

This is my css
#site-content{
margin:25px 0 0 260px;
}
.site-content{
width:740px;
margin:auto;
}
#site-menu{
float:left;
width: 260px;
padding: 20px 0;
overflow:hidden;
}
HTML
<div id="site-menu">
<ul>
<li class="menu"><a id="menu-glxavor" class="menu" href="/"></a></li>
<li class="menu"><a id="menu-mermasin" class="menu" href="/arm/about-us"></a></li>
<li class="menu"><a id="menu-usucich" class="menu" href="/arm/for-teachers"></a>
<ul id="menu-usucich-sub">
<li class="sub-menu"><a class="a-sub-menu usucich" href="/arm/for-teachers/teacher-schedule">Դասացուցակ</a></li>
<li class="sub-menu"><a class="a-sub-menu usucich" href="/arm/for-teachers/homeroom-teachers">Դասղեկներ</a></li>
<li class="sub-menu"><a class="a-sub-menu usucich" href="/arm/for-teachers/exemplary-lessons">Օրինակելի դասեր</a></li>
<li class="sub-menu"><a class="a-sub-menu usucich" href="/arm/for-teachers/teacher-training">Վերապատրաստում</a></li>
</ul>
</li>
<li class="menu"><a id="menu-ashakert" class="menu" href="/arm/for-pupils"></a></li>
<li class="menu"><a id="menu-shrjanavartner" class="menu" href="/arm/graduates"></a></li>
<li class="menu"><a id="menu-norutyunner" class="menu" href="/arm/news"></a></li>
<li class="menu"><a id="menu-mankapartez" class="menu" href="/arm/kindergarten"></a></li>
<li class="menu"><a id="menu-nyuter" class="menu" href="/arm/materials"></a></li>
<li class="menu"><a id="menu-bajanortagrvel" class="menu" href=""></a></li>
<div id="subscribe">
<input type="text" id="subscribe-name" placeholder="email" name="subscribe-name" />
<button class="large awesome blue" id="sub-button" type="submit">բաժանորդագրվել</button>
<div id="sub-notification"></div>
</div>
</ul>
</div>
<div id="site-content">
<div class="site-content">
<div class="pages-content-top"></div>
<div class="pages-content-center">
<h2>Համագործակցություն 1</h2><div><span class='img'><img src=/views/admin/uploads/hands.jpg></img></span><span class='text'>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rutrum aliquet erat tempus lacinia. Fusce congue enim lacus, adipiscing sollicitudin libero feugiat sed. Phasellus suscipit, lorem ac bibendum pharetra, sem neque commodo nulla, in dignissim dolor leo eu nulla. Maecenas eu faucibus turpis. Maecenas in nulla at nisl varius commodo. In facilisis enim mattis eros bibendum pulvinar. Phasellus congue odio quis diam viverra, eu aliquam dui consequat. Etiam massa arcu, condimentum vel rutrum a, ultrices quis felis.</span><span class='read-more'><a href='/arm/read?category=about-us&id=37'>Ավելին...</a></span></div><div style='clear:both'></div>
<h2>Համագործակցություն 2</h2><div><span class='img'><img src=/views/admin/uploads/hands.jpg></img></span><span class='text'>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rutrum aliquet erat tempus lacinia. Fusce congue enim lacus, adipiscing sollicitudin libero feugiat sed. Phasellus suscipit, lorem ac bibendum pharetra, sem neque commodo nulla, in dignissim dolor leo eu nulla. Maecenas eu faucibus turpis. Maecenas in nulla at nisl varius commodo. In facilisis enim mattis eros bibendum pulvinar. Phasellus congue odio quis diam viverra, eu aliquam dui consequat. Etiam massa arcu, condimentum vel rutrum a, ultrices quis felis.</span><span class='read-more'><a href='/arm/read?category=about-us&id=38'>Ավելին...</a></span></div><div style='clear:both'></div>
<h2>Համագործակցություն 3</h2><div><span class='img'><img src=/views/admin/uploads/hands.jpg></img></span><span class='text'>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rutrum aliquet erat tempus lacinia. Fusce congue enim lacus, adipiscing sollicitudin libero feugiat sed. Phasellus suscipit, lorem ac bibendum pharetra, sem neque commodo nulla, in dignissim dolor leo eu nulla. Maecenas eu faucibus turpis. Maecenas in nulla at nisl varius commodo. In facilisis enim mattis eros bibendum pulvinar. Phasellus congue odio quis diam viverra, eu aliquam dui consequat. Etiam massa arcu, condimentum vel rutrum a, ultrices quis felis.</span><span class='read-more'><a href='/arm/read?category=about-us&id=39'>Ավելին...</a></span></div><div style='clear:both'></div>
</div>
<div class="pages-content-fot"></div>
</div>
</div>
site-content got all width except the menu (that why #site-content{margin:0 0 260px 0}). #site-content contains div .site-content which got fixed width (740px). It is centered in #site-content (that why .site-content{width:740px;margin:auto;}). .site-content contains articles, which should have spaces right after next articles. That why i used clear both, but its getting the next articles after menu, so it clears all floats (the menu float). Solution please!
http://jsfiddle.net/isherwood/WP66N/1/
I'd just take out the clearing divs and be happy:
http://jsfiddle.net/isherwood/WP66N/2/
<div class="pages-content-center">
<h2>Համագործակցություն 1</h2>
<div><span class='img'>
...
I guess that the real problem is that .img or .text still need to be floated and the headings after them need clearance. I'd suggest to add overflow: hidden to .site-content to isolate its contents (floated or not) in the separate block formatting context:
.site-content {
width:540px;
margin:auto;
overflow: hidden;
}
Fiddle (with example floated images)
If I were you I would just avoid to use float. I would recommend you to use some divs with fix dimension and
display: inline-block;
This way the divs will just be positioned besides each other and you will need tricks as clear:both and so on. The only thing, pay attention the display: inline-block; will not work fine with IE7. Just use display: inline with that.