Do not want the text to be centered - html

i've never programmed before or anything, but i have a college project in which i have to edit a layout.
there's a part of it in which the text is kinda in center, when it reaches the center of the page it skippes to next line.. i want it to continue normally..
https://jsfiddle.net/nqpa6jh0/#&togetherjs=vORwosTiHV
.image.feature2 {
display: block;
margin: 0 0 0em 0;
}
.image.feature2 img {
display: block;
width: 100%;
border-radius: 50%;
width: 200px;
height: 200px;
float: left
}
.image.feature3 img {
display: block;
width: 100%;
border-radius: 50%;
width: 200px;
height: 200px;
float: right;
<div class="wrapper style2">
<section class="container">
<header class="major">
<h2>Depoimentos</h2>
<span class="byline">Os viajantes recomendam.</span>
</header>
<div class="row no-collapse-1">
<section class="">
<a class="image feature2"><img src="images/pic02.jpg" alt=""></a>
<p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
</section>
</div>
</section>
</div>
here's how it's looking
that's how i wanted it to look like (photoshopped the first one):

Let me explain it properly to you.
From the photoshopped image, I can see what you are trying to achieve as well as the errors in your code. There are plenty of them.
Here: (redundant code)
.image.feature2 img {
display: block;
width: 100%;
border-radius: 50%;
width: 200px;
height: 200px;
float: left
}
.image.feature3 img {
display: block;
width: 100%;
border-radius: 50%;
width: 200px;
height: 200px;
float: right;
}
You are not using classes properly. Classes are meant to remove the redundant code in css. Lets consider you added a class myParentClass to the div containing the sections as well remove the class image feature2 on a element. Then the html would look like:
<div class="myParentClass row no-collapse-1">
<section class="">
<a ><img src="images/pic02.jpg" alt=""></a>
<p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
</section>
<section class="">
<a><img src="images/pic02.jpg" alt=""></a>
<p>Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat.</p>
</section>
</div>
The above css can be replaced with:
.myClass section a img {
display: block;
width: 100%;
border-radius: 50%;
width: 200px;
height: 200px;
float: left
}
.myParentClass section:nth-child(odd) a img {
float: right;
}
And in order to make the text inside the p elements not to wrap around, you need to add white-space": nowrap. So:
.myParentClass section p {
white-space: nowrap;
}
And to have the effect of having some whitespace to the left of odd section elements, you must use padding i.e,
.myParentClass section:nth-child(odd){
padding-left: 50px;
}

Related

How do I wrap text around image with a colored text box?

image of what I am trying to do
I am trying to have an image aligned left with a colored text box that overlaps (positioned off-center) to the image. I can get that by creating a div class="mycontainer" with div class= my text-box" and css (see below), but I can't seem to figure out how to make text wrap around the colored text box. It wraps around the image, but keeps pushing the text box down.
.mycontainer {
position: relative;
font-family: Arial;
width: 100%;
}
.mytext-block {
position:absolute;
margin-top: 50px;
margin-left: 150px;
background-color:turquoise;
color: black;
padding-left: 10px;
padding-right: 10px;
}
Hi Rachel here is a way to wrap text around an image which is inset into a colored box.
.mycontainer {
position: relative;
font-family: Arial;
width: 100%;
margin: auto;
max-width: 670px;
}
.mytext-block {
width: 300px;
height: 400px;
float: left;
vertical-align: middle;
background-color: turquoise;
color: black;
}
#image {
width: 250px;
height: 100px;
position: relative;
float: left;
left: -190px;
shape-outside: content-box;
margin: 140px -170px 0 0;
}
#text {
font-size: 140%;
padding: 30px;
}
<div class="mycontainer">
<div class="mytext-block"></div>
<img id="image" src="https://lorempixel.com/300/100/">
<div id="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellen tesque placerat dolor sed dolor euismod hendrerit. Integer eget elit nibh. Vestibulum posuere. Sed elementum bibendum magna, nec tempus augue egestas quis. Pellentesque lacus justo, vehicula vitae nisl sed, semper euismod dui.
</div>
</div>
<!-- Click the "Run code snippet" below to see it. Hope this helps. -->

How do I make a stack of divs that stick to the bottom of their parent div?

I am making a simple messaging app UI. I am trying to make the messages anchor to the bottom of the screen like most modern messaging applications. So far, here is the bare bones of my messaging UI:
HTML
<div class="main-wrapper">
<div class="contact-list">
contacts here
</div>
<div class="conversation-area">
<div class="msg msg-them">this is Alison</div>
<div class="msg msg-me">this is me!</div>
<div class="msg msg-them">you are so cool! :)</div>
<div class="msg msg-them">seriously.</div>
</div>
</div>
SASS
body, html {
height: 100%;
}
.main-wrapper {
height: 100%;
margin: 0px auto;
overflow: hidden;
.contact-list{
float: left;
width: 200px;
height: 100%;
background-color: #aaa;
border-right: 2px solid #777;
}
.conversation-area{
overflow: hidden;
height: 100%;
background-color: #ccc;
.msg{
vertical-align: bottom;
border: 1px solid black;
&-them{
background-color: blue;
float: left;
max-width: 250px;
display: inline;
clear: both;
}
&-me{
background-color: red;
float: right;
max-width: 250px;
display: inline;
clear: both;
}
}
}
}
Whenever a new message comes in, I'll insert it as the last child of the .conversation-area div. I have the messages stacking just like I want them. I just need to make them stick to the bottom of the .conversation-area div.
I've tried messing with position attributes of both the parent and child divs, as well as tried to get vertical-align to work, but so far I haven't gotten it functioning.
How can I make my messaging app look exactly the same EXCEPT the messages stick to the bottom rather than the top?
Here's the jsFiddle: https://jsfiddle.net/63vufn7u/1/
You can achieve this with display:table-cell; and vertical-align:bottom;
I have made some changes to your code but im sure you can adapt now its working:
.main-wrapper {
width: 100%;
height: 200px;
font-family:sans-serif;
}
.contact-list {
width:25%;
display: table-cell;
height: 200px;
background: #555;
color: #fff;
text-align: center;
float: left;
}
#conversation-area {
height: 200px;
width: 300px;
background: steelblue;
display: table-cell;
vertical-align: bottom;
}
.msg {
display: block;
margin: 15px 10px;
}
.msg p {
border-radius:5px 5px 5px 5px;
background: #fff;
display: inline;
padding: 5px 10px;
box-shadow: 3px 3px 5px 0px rgba(0,0,0,0.75);
}
.msg-me {
text-align: left;
}
.msg-me p {
border-radius:15px 15px 15px 0px;
}
.msg-them {
text-align: right;
}
.msg-them p {
border-radius:15px 15px 0px 15px;
}
<div class="main-wrapper">
<div class="contact-list">
Contacts
</div>
<div id="conversation-area">
<div class="msg msg-them"><p>this is Alison</p></div>
<div class="msg msg-me"><p>this is me!</p></div>
<div class="msg msg-them"><p>you are so cool! :)</p></div>
<div class="msg msg-them"><p>seriously.</p></div>
</div>
</div>
Your friendly neighborhood Flexbox solution:
On the container, you could also use the justify-content property to align it's contents to the bottom:
.conversation-area {
display:flex;
flex-direction:column;
justify-content:flex-end;
}
Learn more about flexbox here: http://www.flexboxin5.com
The easiest way I've found is to use flex-direction: column-reverse;.
The drawback to flex-direction: column; is that it starts you at the top and you have to scroll down for older texts. And that's not how chat app interfaces tend to work.
column-reverse makes the texts stick to the bottom. The tradeoff is you have to insert your messages in ascending time stamp order instead of reversed like you normally would, because flex-box does the reversing in css. Same with any animations. So new text bubble animation would be applied to the :first child rather than the :last child.
Here's an example without animations: https://jsfiddle.net/ut1Lybsj/1/
<style>
.container {
height: 200px;
width: 200px;
overflow-y: scroll;
display: flex;
flex-direction: column-reverse;
border: 1px solid black;
}
.container div {
margin-top: 20px;
}
</style>
<div class="container">
<div style="background:red;">First Item<br/> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada semper purus, non rutrum nulla mollis id. Nunc faucibus hendrerit nunc, eu rhoncus nisi congue non. </div>
<div style="background: skyblue;">Second Item<br/> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada semper purus, non rutrum nulla mollis id. Nunc faucibus hendrerit nunc, eu rhoncus nisi congue non. </div>
<div style="background: green;">Third Item<br/> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada semper purus, non rutrum nulla mollis id. Nunc faucibus hendrerit nunc, eu rhoncus nisi congue non. </div>
</div>

CSS - Left Menu

I must preface this post by saying my CSS isn't great!
I have a page with a menu on the left, which is essentially an unordered list, wrapped in a div to apply the CSS
<div class="leftMenu" id="jobMenu">
<ul>
<li ng-click="menuClick(1)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(2)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(3)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(4)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(5)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(6)">
<p>Menu Item</p>
</li>
</ul>
</div>
Menu CSS:
.leftMenu {
display: block;
text-align: center;
float: left;
height: 94vh;
border: 1px solid #778390;
width: 120px;
background-color: #778390;
color: white;
}
.leftMenu ul {
margin-top: 0;
list-style: none;
padding: 0;
}
.leftMenu li {
text-align: center;
border-bottom: 1px solid #58626B;
padding-bottom: 18px;
padding-top: 18px;
cursor: pointer;
font-size: 14px;
}
.leftMenu li:hover {
background-color: #5d9eca;
}
.leftMenu li p {
margin: 0;
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 13px;
}
On the right hand side, I have a main page, with a Kendo Grid (the issue occurs no matter what the content is).
<div class="bottomSection">
<kendo-grid options="mainGridOptions">
</kendo-grid>
</div>
CSS:
.bottomSection {
display: block;
padding: 12px 15px;
/*float: right;*/
width: 84.5%;
height: 60%;
/*margin-right: 66px;*/
}
On most displays, the layout renders perfectly, like so:
However if I resize the window and/or zoom in, the bottomSection div is thrown under the left menu like so:
How can I make it so whenever the window is resized, the leftMenu always stays at 120px width and the bottomSection div resizes itself, so they both stay side by side no matter what size the window is? I would have thought using the percentage as a width property would achieve this?
Thanks in advance!
.leftMenu {
display: block;
text-align: center;
position: absolute;
left: 0;
top: 0;
height: 94vh;
border: 1px solid #778390;
width: 120px;
background-color: #778390;
color: white;
}
.bottomSection {
display: block;
padding: 12px 15px;
width: 100%;
padding-left: 135px;
height: 60%;
box-sizing: border-box;
}
Let me preface my solution by suggesting that you use a percentage for your left menu also, so that mobile devices would have a good experience. With a fixed width on one div, and a percentage on the other, you're bound to have layout problems.
With that said, if you're constrained to use a fixed with for the left menu, here's a solution - I've cut out some of the markup, to focus on the major layout aspects:
html, body {
margin: 0;
padding: 0;
}
.container {
width: 100%;
position: relative;
}
.leftMenu {
background-color: #333;
color: #FFF;
height: 200px; /* for demo purposes */
width: 120px;
position: relative;
}
.bottomSection {
background-color: #CCC;
color: #FFF;
padding: 10px;
position: absolute;
left: 120px;
right: 0;
}
.leftMenu, .bottomSection {
display: inline-block;
vertical-align: top;
}
<html>
<head>
</head>
<body>
<div class="container">
<div class="leftMenu">Menu</div>
<div class="bottomSection">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec cursus congue hendrerit. Phasellus luctus quam in nulla mollis finibus. Quisque feugiat, metus sit amet porta fringilla, elit odio sodales mauris, sed gravida turpis felis vitae turpis. Mauris interdum ac magna vel pretium. Nulla porta rutrum velit mollis congue. Proin pellentesque urna et magna lacinia, et tincidunt mi placerat. Nulla suscipit rhoncus viverra. Integer pulvinar at purus non tristique.
</div>
</div>
</body>
</html>
Points to note:
Using display: inline-block for layout instead of float.
A parent div (container) is used: must be set to position: relative (or possibly absolute).
Using absolute for positioning of bottomSection. left is set to 120px (to ignore the left menu); right is set to 0, to stretch to the other side of the screen.
vertical-align is set to top, to keep alignment of the child divs to the top.

HTML/CSS: two divs inside a container div

So this again links to the same website as my other question and is another positioning problem that is possibly simple.
I have a container div that I want to hold two divs inside it, one taking up a 3rd of the container on the right to contain pictures and one to contain text on the left. For some reason however, when telling both inner divs to float left the container seems to disappear and when using inspect element, is in a weird place that I cannot explain.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Toby King - Home</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>
<body>
<div id="banner">
<div class="menu">
<div class="menuBit">
<h2 class="menuContent">HOME</h2>
</div>
<div class="menuBit">
<h2 class="menuContent">BLOG</h2>
</div>
<div class="menuBit">
<h2 class="menuContent">WORK</h2>
</div>
</div>
</div>
<div class="main">
<div class="textSection">
<div class="mainTextSection">
<h1 class="maintext">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent rhoncus erat nec porttitor facilisis. In hac habitasse platea dictumst. Mauris id faucibus arcu. Mauris non orci mauris. Vivamus a porta odio. Praesent at purus ante. Quisque magna odio, elementum ut facilisis vitae, consequat at tellus. Praesent nulla est, ultrices sit amet sagittis eget, consequat id justo. Integer elementum in nibh eu ultricies. Integer fringilla urna in mollis accumsan. Etiam iaculis urna et malesuada tincidunt. Nunc dignissim purus eu tempor bibendum.</h1>
</div>
<div class="mainPictureSection">
<img src="images/Example.svg">
</div>
</div>
</div>
<div id="footer">
<h2 class="social">CONTACT:</h2>
<img src="images/fb.png" class="social">
<h2 class="social">some text</h2>
<img src="images/insta.png" class="social">
<h2 class="social">some text</h2>
</div>
</body>
</html>
CSS:
#banner {
height: 50px;
width: 100%;
margin: 0px;
padding: 0px;
overflow: hidden;
position: fixed;
background-image: url("images/menuHor.png");
}
.menuBit {
height: 40px;
width: 100px;
margin: 0px;
padding: 0px;
float: left;
margin-left: 10px;
}
.menuContent:hover {
text-decoration: underline;
cursor: pointer;
}
.menuContent {
font-family: "cicle-gordita";
font-size: 30px;
text-align: center;
padding: 0px;
margin: 0px;
margin-top: 10px;
color: #ffffff;
}
.main {
position: fixed;
margin: 0px;
margin-top:50px;
padding: 0px;
width: 100%;
height: 94.7916666667%;
overflow: scroll;
background: url("images/backgr.png");
}
.maintext {
font-family: "cicle-gordita";
}
.textSection {
width: 65%;
height: auto;
background: #FFFFFF;
margin-right: 17.5%;
margin-left: 17.5%;
margin-top: 2.5%;
margin-bottom: 5%;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
.mainPictureSection {
height: auto;
width: 21.67%;
float: left;
overflow: hidden;
margin: 0px;
padding: 0px;
}
.mainTextSection {
height:auto;
width: 43.33%;
float: left;
margin: 0px;
padding: 0px;
}
#footer {
width: 100%;
height: 30px;
clear: both;
position: fixed;
bottom: 0;
background-image: url("images/menuHor.png");
}
.social {
float: left;
padding: 0;
margin-top: 0px;
margin-bottom: 2.5px;
margin-left: 10px;
font-family: "cicle-gordita";
color: #ffffff;
}
.social h2 {
margin-top: 5px;
}
The Jscript/jQuery file is just to fade bits in and out but contributes no effect to positioning
Change float: left to display: inline-block should be the best way to do this.
display: inline-block adds white-space. One way to remove this is adding comments between your divs:
<div class="container">
<div class="child">
</div><!--
--><div class="child">
</div>
</div>
or have the divs inline like this:
<div class="container">
<div class="child"></div><div class="child"></div>
</div>
To align them at the top add vertical-align: top to the child divs.
Where has the parent element gone?
If a container has only floating children, its height will collapse as floating elements are not considered when calculating height of a container. You need to clear those floating elements to make the container actually contain the floating children.
One way to do this is by adding a clearfix and putting the class on the container element (taken from http://nicolasgallagher.com/micro-clearfix-hack/):
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.clearfix {
*zoom: 1;
}
That's kind of ugly. Any other solution?
There is an (more than one) alternative, though, the most common probably being using display: inline-block instead of float: left.
Unfortunately, looking at the following example you'll see it does not work as expected initially:
.container {
background-color: #a00;
}
.child {
background-color: #f0f0f0;
display: inline-block;
width: 50%;
}
<div class="container">
<div class="child">Child One</div>
<div class="child">Child Two</div>
</div>
You see that the second container wraps to a new line even though both have been defined to have their fair share of 50% of the container's width.
Why does this happen?
As soon as your HTML contains any sort of whitespace between inline-block elements, it's going to get rendered and consume space.
So how can I fix that?
The most common way to avoid that is to set the container's font-size: 0; (which is not always the go-to-solution, but in most cases), and re-setting it ony the children as needed:
.container {
background-color: #a00;
font-size: 0;
}
.child {
background-color: #f0f0f0;
display: inline-block;
font-size: 16px;
width: 50%;
}
<div class="container">
<div class="child">Child One</div>
<div class="child">Child Two</div>
</div>

Html and CSS site changes between platforms

Hello I have made a website where people can get information on various topics. I spent all day yesterday adding in Rectangles to the background to make the site look slightly nicer. Last night I looked at the site on my phone and saw that the rectangles were not lined up correctly like they should be and the way they are on PC. I dont have enough reputation to post Images so I'll describe the problem.
On pc a rectangle is drawn behind one block of text and a rectangle is drawn behind an image. On the phone the image has the rectangle behind it but the text only has part of the rectangle behind it. Its as if they wont line up or the text is being re-formatted or something. The site name is omicrome.com if you want yo see for yourself. Here's the code that takes care of the part of the site with the problem.
<div class = "container_24">
<header>
<div id = "rectban"></div>
<h1>Omicrome</h1>
<nav>
<ul>
<li><a href="# " class = selected>Home</a></li>
<li>Articles</li>
<li><a href="software.html">Projects</a ></li>
<li>About</li>
</ul>
</nav>
<div id = "rect0"></div>
<div class = "banner grid_18" href="about.html">
View Article
<h2>
</h2>
</div>
<div class=" grid_8 callout"></div>
View Gallery
</header>
<div id = "rect1"></div>
<div id = "rectIndexContact"></div>
<div id = "contactblock">
<h6>Contact</h6>
<center>Email</center>
<center>Twitter</center>
</div>
<div class = "main clearfix">
<div class ="grid_9">
<h3>About The Site</h3>
<p>Here at Omicrome we are always coming up with new and innovative ideas for the future and for the present. These ideas are researched and expanded upon to make them a reality. View our ideas in the article section...
<p>Find Out More</p>
</div>
<div class ="grid_9">
<h3>Our Content</h3>
<p>We post a variety of ideas and project's based around space and technology. Some of them include a hand held cheap computer, software to teach people about space... </p><p>
</p>
<br>
<p>Find Out More</p>
</div>
<div class ="grid_6">
</div>
Here is the CSS:
#rect1{
position: absolute;
margin-top: 10px;
margin-left: -6px;
width: 750px;
height: 208px;
background: #ffffff;
z-index: -1;
}
#rect2{
position: absolute;
margin-top: 195px;
margin-left: -6px;
width: 750px;
height: 1663px;
background: #ffffff;
z-index: -1;
}
h6{
font-size: 26px;
border-bottom: 1px solid #d1d1d1;
padding-bottom: 20px;
margin-bottom: 15px;
line-height: 1em;
padding-right: 83px;
}
.banner{
background: url(../img/rectoday.jpg) no-repeat;
width:695px;
height:250px;
margin-top: 10px;
clear:both;
}
.callout{
background: url(../img/callout.png) no-repeat;
text-indent: -9999px;
width : 250px;
height:250px;
margin: -250px 710px 22px;
float: left;
}
header{
overflow: hidden;
}
header h1{
background: url(../img/logo.png) no-repeat;
text-indent: -9999px;
width : 220px;
height:60px;
margin: -10px 5px 22px;
float: left;
}
nav{
float: right;
padding-top:10px;
margin-right: 09px;
}
nav li{
display: inline;
}
li{
margin-left: 24px;
}
nav a{
text-transform: lowercase;
}
.grid_4{
}
.grid_3{
margin-left: 60px;
}
a{
color:#7e7e7e;
text-decoration: none;
}
a:hover, .selected{
color: black;
}
a:.selected{
color:black;
}
p{
font-size: 13px;
line-height: 20px;
color: #353535;
}
The rectangles are just with the id "rect1" or "rect0". Here is a link to the screenshots: https://drive.google.com/open?id=0B5JL3GH0xtHPMzVESWhSb1JDa0k and https://drive.google.com/file/d/0B5JL3GH0xtHPdUZSZm1ZMlFYWGs/view?usp=sharing How can I make the rectangles match up with the text and images the same way on pc's and phone's? Thanks -Jack.
UPDATE:
Created another example for clarification: jsfiddle updated.
There are two cases in the example below, the first one uses a wrapper like I am recommending, and the second one uses a rectangle using position absolute and fixed height like you are using. Check it out in different viewports and see what happens.
HTML:
<div class="wrapper">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vitae massa eget ante tincidunt finibus. Maecenas dolor ipsum, feugiat a lacus quis, efficitur egestas elit. Cras quis mattis eros. Aliquam enim felis, sollicitudin ac orci at, mattis interdum libero. Nunc pretium mi diam, sit amet facilisis urna condimentum cursus. Aliquam fringilla ipsum aliquam tortor sodales aliquet. Sed imperdiet odio vitae malesuada molestie.
</p>
</div>
<div class="rect1"></div>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vitae massa eget ante tincidunt finibus. Maecenas dolor ipsum, feugiat a lacus quis, efficitur egestas elit. Cras quis mattis eros. Aliquam enim felis, sollicitudin ac orci at, mattis interdum libero. Nunc pretium mi diam, sit amet facilisis urna condimentum cursus. Aliquam fringilla ipsum aliquam tortor sodales aliquet. Sed imperdiet odio vitae malesuada molestie.
</p>
CSS:
.wrapper {
background-color: #7DF481;
padding: 10px 20px;
}
.rect1 {
position: absolute;
top: 140px;
background-color: #ff0000;
height: 90px;
width:100%;
z-index: -1;
}
EDIT:
You should read more about responsive design, you could use a framework like Bootstrap. There's also media features that limit the stylesheet's scope, you can read more about that here: Using Media Queries.
The problem is that you are relying on a fixed height for your rectangles. The text will try to fit in the viewport of your device, making your container have a higher height. I recommend you using a wrapper instead of fixed rectangles. Here's an example: jsfiddle
HTML:
<div class="container_24">
<header>
<div id="rectban"></div>
<h1>Omicrome</h1>
<nav>
<ul>
<li><a href="# " class=s elected>Home</a></li>
<li>Articles</li>
<li><a href="software.html">Projects</a ></li>
<li>About</li>
</ul>
</nav>
<div id="rect0"></div>
<div class="banner grid_18" href="about.html">
View Article
<h2>
</h2>
</div>
<div class=" grid_8 callout"></div>
View Gallery
</header>
<div id="rect1">
<div id="rectIndexContact"></div>
<div id="contactblock">
<h6>Contact</h6>
<a href="mailto:crew#omicrome.com" class="button" id="contactEMAIL">
<center>Email</center>
</a>
<a href="https://twitter.com/Error404inSpace" class="button" id="contactTwitter">
<center>Twitter</center>
</a>
</div>
<div class="main clearfix">
<div class="grid_9">
<h3>About The Site</h3>
<p>Here at Omicrome we are always coming up with new and innovative ideas for the future and for the present. These ideas are researched and expanded upon to make them a reality. View our ideas in the article section...
<p>Find Out More</p>
</div>
<div class="grid_9">
<h3>Our Content</h3>
<p>We post a variety of ideas and project's based around space and technology. Some of them include a hand held cheap computer, software to teach people about space... </p>
<p>
</p>
<br>
<p>Find Out More</p>
</div>
<div class="grid_6">
</div>
</div>
CSS:
#rect1 {
background-color: #ffffff;
padding: 10px 20px;
}
#rect2 {
position: absolute;
margin-top: 195px;
margin-left: -6px;
width: 750px;
height: 1663px;
background: #ffffff;
z-index: -1;
}
h6 {
font-size: 26px;
border-bottom: 1px solid #d1d1d1;
padding-bottom: 20px;
margin-bottom: 15px;
line-height: 1em;
padding-right: 83px;
}
.banner {
background: url(../img/rectoday.jpg) no-repeat;
width: 695px;
height: 250px;
margin-top: 10px;
clear: both;
}
.callout {
background: url(../img/callout.png) no-repeat;
text-indent: -9999px;
width: 250px;
height: 250px;
margin: -250px 710px 22px;
float: left;
}
header {
overflow: hidden;
}
header h1 {
background: url(../img/logo.png) no-repeat;
text-indent: -9999px;
width: 220px;
height: 60px;
margin: -10px 5px 22px;
float: left;
}
nav {
float: right;
padding-top: 10px;
margin-right: 09px;
}
nav li {
display: inline;
}
li {
margin-left: 24px;
}
nav a {
text-transform: lowercase;
}
.grid_4 {}
.grid_3 {
margin-left: 60px;
}
a {
color: #7e7e7e;
text-decoration: none;
}
a:hover,
.selected {
color: black;
}
a:.selected {
color: black;
}
p {
font-size: 13px;
line-height: 20px;
color: #353535;
}