Content not within div - html

I'm using Bootstrap and my issue is that the content (ul) within the "forecastDiv" is not inside the "forecastDiv" border. The content stays inside the border once I remove Bootstrap's grid system but I need to align my content properly so I need to be using the grid system. Below is the code I have in a codepen (go to "6-day forecast" comment in HTML). Any help is appreciated. Thank you.
HTML
<div id="forecastDiv">
<div class="col-md-1" id="boxInfo0">
<p id="forecast0">0
</p>
<p id="forecast0TempC">0
</p>
<p id="day0">Test
</p>
</div>
<div class="col-md-1" id="boxInfo1">
<p id="forecast1">0
</p>
<p id="forecast1TempC">0
</p>
<p id="day1">Test
</p>
</div>
<div class="col-md-1" id="boxInfo2">
<ul id="forecast2">0
</ul>
<ul id="forecast2TempC">0
</ul>
<ul id="day2">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo3">
<ul id="forecast3">0
</ul>
<ul id="forecast3TempC">0
</ul>
<ul id="day3">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo4">
<ul id="forecast4">0
</ul>
<ul id="forecast4TempC">0
</ul>
<ul id="day4">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo5">
<ul id="forecast5">0
</ul>
<ul id="forecast5TempC">0
</ul>
<ul id="day5">Test
</ul>
</div>
</div> <!-- end forecastDiv -->
CSS
#forecastDiv {
width: 100%;
border: solid black;
margin: 0 auto; }
https://codepen.io/mcmaster-99/pen/ybWvyy

add a "container" or "container-fluid" class to your <div id="forecastDiv">. "container" is a bootstrap class that will keep everything inside the div.
<div class="container" id="forecastDiv">

Related

Overriding Bootstrap Container Full Width Background Color

I'm trying to have my container divs background color extend to the full width of the browser. Right now I am unable to bypass the container styling set up by default in bootstrap, despite adding my own class to the container. The only styling that works is the background-color. I have also tried the following CSS, but it didn't make any change.
margin-right: auto;
margin-left: auto;
padding-left: 0px;
padding-right: 0px;
background-color: #FDDC00;
Here is my HTML:
<div class="container selection-section">
<div class="row pattern-choice">
<div class="col-md-12">
<h2><i>Choose a pattern</i></h2>
<ul>
<li class="button-border">
<h3 class="button-choice" >SOLID</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="stripe-choice">STRIPE</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="plaid-choice">PLAID</h3>
</li>
</ul>
</div>
</div>
</div>
Here is my CSS:
.selection-section {
margin-right: auto;
margin-left: auto;
padding-left: 0px;
padding-right: 0px;
background-color: #FDDC00;
}
Use container-fluid instead of container if you want the container to extend to the full-width of your webpage.
If it's only the color that's a concern surrounding the container with another div might work for you.
.selection-section {
background: #FDDC00;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div class="selection-section">
<div class="container">
<div class="row pattern-choice">
<div class="col-md-12">
<h2><i>Choose a pattern</i></h2>
<ul>
<li class="button-border">
<h3 class="button-choice">SOLID</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="stripe-choice">STRIPE</h3>
</li>
<li class="button-border">
<h3 class="button-choice" id="plaid-choice">PLAID</h3>
</li>
</ul>
</div>
</div>
</div>
</div>
<hr>
<div class="container">
<div class="well">Outside Div</div>
</div>

Fix Sidebar in the same row as other elements

So basically I have a sidebar which I wan't to be fixed in my page and have only the other column in my row be scrollable.
I tried changing the position css attribute of the element, but then the original content would be squished into the first column.
A demo of what I have is available here: JSFiddle
Here is my HTML:
<div class="container">
<div class="row">
<div class="col-4" role="sidebar">
<div class="diamond"><span>RS</span></div>
<br />
<div class="brief">
Text here...
</div>
<form class="search">
<input type="text" placeholder="Search...">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
<ul class="sidebar-menu">
<li class="github">Github</li>
<li class="twitter">Twitter</li>
<li class="stackoverflow">StackOverflow</li>
<li class="linkedin">LinkedIn</li>
</ul>
</div>
<div class="col-8" role="content">
<h1 class="title">Title</h1><div class="horizontal-rule"></div>
<nav class="subnav">
<ul>
<li>Link</li> /
<li>Link</li> /
<li>Link</li> /
<li>Link</li>
</ul>
</nav>
</div>
</div>
</div>
I don't know which element you want to have fixed, but you could use this method:
<div id="id">
Content of the div
</div>
And the CSS:
#id {
position: fixed;
left: 30px; // or whatever you want
top: 100px; // or whatever you want
}
I hope this helped for you!

separater and list-group from bootstrap are flowing through divs

My pen: http://codepen.io/helloworld/pen/yyoJGR
Why is the white separater and the list-grouping flowing through the divs or the parent row?
<div class="container columnStyle">
<div class="row">
<div class="row-same-height">
<div class="col-xs-3 col-xs-height">
<img class="img-responsive" src="http://s7.postimg.org/agarkavmj/whoiswho.png"></img>
</div>
<div class="col-xs-9 col-xs-height" >
<div class="container">
<div class="row">
<div class="page-header">
<h1>Who is who
<p>
<small>Organization & Processes</small>
</p>
</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<ul class="list-group">
<li class="list-group-item">Org Charts </li>
<li class="list-group-item">GAM / KAM Charts</li>
<li class="list-group-item">Process flow</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
.columnStyle{
background: #006AB3;
}
Because you use the class .containermultiple times.
This class has a fixed width of 1170px;
.container {
width: 1170px;
}
you should have only 1 .containerfor the wrapper and then, inside of it, remove the other .container and just use .row
See it in action : http://codepen.io/anon/pen/ogeLRb

In code footer goes all over the place

I have some troubles with my footer on a website. Footer is not displaying at the bottom of the page but it starts right below the header and covers elements that are under it. For better understanding I made fiddle for it and screenshot
But its like this:
<div class="mens">
<div class="main">
<div class="wrap">
<div class="section group">
<div class="cont span_2_of_3">
<h2 class="head">PRIPOROČAMO</h2>
<div class="top-box">
and then there are some products and then there are the end divs for this:
</div>
</div>
</div>
</div>
</div>
</div>
And then follows the footer:
<footer class="footer-2 bg-midnight-blue">
<div class="container">
<nav class="pull-left">
<ul>
<li class="active">
Home
</li>
<li>
Company
</li>
<li>
Portfolio
</li>
<li>
Blog
</li>
<li>
Contact
</li>
</ul>
</nav>
<div class="social-btns pull-right">
<div class="fui-vimeo"></div><div class="fui-vimeo"></div>
<div class="fui-facebook"></div><div class="fui-facebook"></div>
<div class="fui-twitter"></div><div class="fui-twitter"></div>
</div>
<div class="additional-links">
Be sure to take a look to our Terms of Use and Privacy Policy
</div>
</div>
</footer>
And I know its a lot of code but I would really appreciate if someone could look at it. Thanks.
use this to reset ur css
.clearfix:before,.clearfix:after{content: '.';display: block;overflow: hidden;visibility: hidden;font-size: 0;line-height: 0;width: 0;height: 0;clear: both;}
.clearfix {overflow: auto;zoom: 1;}
and add clearfix class in parent div where in child u have used float like in
<div class="page-wrapper clearfix">
<div class="main clearfix">
<footer class="footer-2 bg-midnight-blue clearfix">

split a sidebar into two

I hope you can all help :)
I have a sidebar on my website but because I don't want it going under the fold I would like to split this ten li sidebar into two 5 li sidebars with a div inbetween them showing content using Jquery. I have coded up the website so it looks good but I need the sidebars to act as one menu instead of two so only one selection can be made at a time , one current class etc. Anyone know how to do this? My mark-up is as follows:
<div id="sidebar">
<ul class="list2"><em>
<li class="current1">Bilgorajski</li>
<li>Rzeszowski</li>
<li>Kasuby</li>
<li>Mazur</li>
<li>Lubelski</li>
</em>
</ul>
</div>
<div id="repcontent">
</div>
<div id="sidebar">
<ul class="list2"><em>
<li>Powislainski</li>
<li>Podhalainski</li>
<li>Kujuwiak Oberek</li>
<li>Krakowiak</li>
<li>Szlansk</li>
</em>
</ul>
</div>
You just have to remove tags that commented in the following code:
<div id="sidebar">
<ul class="list2"><em>
<li class="current1">Bilgorajski</li>
<li>Rzeszowski</li>
<li>Kasuby</li>
<li>Mazur</li>
<li>Lubelski</li>
</em>
</ul>
<!-- </div> -->
<div id="repcontent">
</div>
<!-- <div id="sidebar"> -->
<ul class="list2"><em>
<li>Powislainski</li>
<li>Podhalainski</li>
<li>Kujuwiak Oberek</li>
<li>Krakowiak</li>
<li>Szlansk</li>
</em>
</ul>
</div>
Edited: To get three columns layout, I will use zurb-foundation CSS framework as follows:
<body>
<div id="header" class="row">
<div class="twelve columns">
Header
</div>
</div>
<div class="row">
<div id="left-sidebar" class="three columns">
<ul class="list2"><em>
<li class="current1">Bilgorajski</li>
<li>Rzeszowski</li>
<li>Kasuby</li>
<li>Mazur</li>
<li>Lubelski</li>
</em>
</ul>
</div>
<div id="repcontent" class="six columns">
Middle contents
</div>
<div id="right-sidebar" class="three columns">
<ul class="list2"><em>
<li>Powislainski</li>
<li>Podhalainski</li>
<li>Kujuwiak Oberek</li>
<li>Krakowiak</li>
<li>Szlansk</li>
</em>
</ul>
</div>
</div>
</body>
take it easy.. use
-webkit-column-count: 2;
this will splits your contents into two columns..Or if you want to display the sidebars in two sides separately then use 2 separate divisions and float:left|right; property. Or you can query for this using JQuery.
<body>
<div class="container">
<div class="sidebar1">
<ul class="nav">
<li>Link one</li>
<li>Link two</li>
<li>Link three</li>
<li>Link four</li>
</ul>
<p> </p>
<!-- end .sidebar1 --></div>
<div class="content">
<!-- end .content --></div>
<div class="sidebar2">
<!-- end .sidebar2 --></div>
<!-- end .container --></div>
</body>
css
.sidebar1 {
float: left;
width: 20%;
background-color: #93A5C4;
padding-bottom: 10px;
}
.content {
padding: 10px 0;
width: 60%;
float: left;
}
.sidebar2 {
float: left;
width: 20%;
background-color: #93A5C4;
padding: 10px 0;
}
Try this code. this may clarifies your problem .