What is the best way for me to resume the flow of the page in css.
Here is my situation:
I have 3 divs div 1(parent), div 1(child), and div 2(normal). parent div is absolute, child is relative. All is good so far. The problem i'm having is the the next normal div is shifted up to the same line as the absolute div (since i disrupted the flow of the page setting the parent div to absolute).
So my question is how do I put the normal div under the div that has the position of absolute. Do I just offset the margin-top property?
Thanks for all the help!
Take a look: https://jsfiddle.net/veLgmdt1/
If you know the height of the absolute-positioned element, it would be easy. Simply add padding / margin or placeholder div equal to the known height.
If the height is dynamic, you'd have to resort to jQuery/JavaScript.
Have a look at my demo which shows the default behaviour and the methods mentioned:
// get the absolute-positioned element
var abs = $("#dynamic .absolute");
// get height of absolute-positioned element
var absHeight = abs.height();
// insert placeholder div with height equal to absolute-positioned element
$("<div class='placeholder'></div>").height(absHeight).insertAfter(abs);
section {
position: relative;
padding: 1em;
margin: 1em;
border: 1px solid #CCC;
}
section div {
border: 1px dashed blue;
}
.absolute {
position: absolute;
top: 0; z-index: 1;
border:1px solid red;
height:50px;
}
#margin .absolute+div {
margin-top:50px;
}
#padding .absolute+div {
margin-top:50px;
}
.placeholder { height:50px; border:none }
#dynamic .absolute {
height:100px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<h3>Default Behaviour</h3>
<section>
<div class="absolute">position:absolute</div>
<div>normal div</div>
</section>
<h3>Known height: top margin</h3>
<section id="margin">
<div class="absolute">position:absolute</div>
<div>normal div with margin-top</div>
</section>
<h3>Known height: top padding</h3>
<section id="padding">
<div class="absolute">position:absolute</div>
<div>normal div with padding-top</div>
</section>
<h3>Known height: placeholder div</h3>
<section>
<div class="absolute">position:absolute</div>
<div class="placeholder"></div>
<div>normal div</div>
</section>
<h3>Dynamic height: JavaScript/jQuery</h3>
<section id="dynamic">
<div class="absolute">position:absolute</div>
<div>normal div</div>
</section>
jsFiddle: https://jsfiddle.net/azizn/mq6bejhf/
http://jsfiddle.net/veLgmdt1/6
Simplified HTML structure by using rows and floated columns. This will eliminate need for margin and absolute positioning.
<div class="content-wrapper">
<div class="row">
<div class="col col-lg-3">
<img src="http://lorempixel.com/230/230/" class="img-rounded">
<button class="btn btn-primary">Invite To Project</button>
<ul class="list-unstyled">
<li>Member Since: July 21, 2016</li>
<li>Toronto, ON</li>
<li>
<ul class="list-inline">
<li>Social:</li>
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-pinterest"></i></li>
<li><i class="fa fa-google-plus"></i></li>
<li><i class="fa fa-youtube"></i></li>
</ul>
</li>
</ul>
</div>
<div class="col col-lg-9">
<h2 class="profile-name">John Doe</h2>
<h4 class="">Graphic Designer</h4>
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
</div>
</div>
<div class="row">
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active">Home <span class="badge">42</span></li>
<li role="presentation">Profile</li>
<li role="presentation">Messages <span class="badge">3</span></li>
</ul>
</div>
</div>
CSS
.content-wrapper {
width: 1000px;
margin: 0 auto;
}
.row {
width: 100%;
padding-top: 20px;
}
.row:nth-child(odd) {
background-color: #f5f5f5;
border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #DDDDDD;
}
.col {
float: left;
}
.col-lg-3 {
width: 25%
}
.col-lg-9 {
width: 75%
}
.profile-heading {
margin-top: 50px;
background-color: #f5f5f5;
border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #DDDDDD;
}
.profile-heading > .panel {
position: relative;
background-color: inherit;
margin: 0 auto;
width: 1000px;
border: none;
}
Related
Basically, I am trying to centre the Contact Form and its Submit button. I've tried a couple CSS suggestions but they do not change it's placement, still being stuck to the left as the button is oddly to the far right of the form. All advice and tips will be appreciated. Just know I am still new to coding so my skills are quite limited as I'm still learning.
Here's a picture of the Contact Us page:
#font-face {
Src: url(customfont/Futuristic.ttf);
font-family: Future;
}
.Contact-box {
position: static;
transform: none;
}
h1 {
margin-bottom: 1rem;
color: red;
text-align: center;
font-size: 40px;
font-family: Future;
}
form {
display: inline-block;
flex-direction: column;
width: 24rem;
gap: 1rem;
margin-left: auto;
margin-right: auto;
}
input,
textarea {
padding: 1.5rem;
background: transparent;
border: 2px solid white;
border-radius: 15px;
width: 400px;
}
textarea {
height: 7rem;
}
button {
width: 8rem;
padding: 1rem;
cursor: pointer;
background: blue;
color: black;
}
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="logo">
<img src="https://via.placeholder.com/95" width="95" />
</div>
<div class="coolname">
<img src="https://via.placeholder.com/105" width="105" />
</div>
<nav>
<ul>
<li class="current-page">Home</li>
<li>About Us</li>
<li>Services</li>
<li>Consultation & Quotes</li>
<li>Contact Us</li>
<li>Client Referrals</li>
<li>Blog</li>
</ul>
</nav>
<br><br>
<h1>Contact Us!</h1>
<div class="Contact-box">
<br><br>
<form style="align:center;">
<input type="text" name="Name" placeholder="First and Last Name" required>
<input type="text" name="Email" placeholder="example#email.com" required>
<input type="text" name="Subject" placeholder="Subject Line" required>
<textarea name="Message" placeholder="Message" required></textarea>
<br><br>
<button type="submit">Send</button>
<br><br>
</form>
</div>
<footer>
<div class="bottom-content">
<h3>Geek Yourself Out</h3>
<p>To get some behind-the-scenes action to staying updated on the latest projects, check out these social media links! All follows, likes, comments, and shares are appreciated. </p>
<div class="socials">
<li>
<img src="facebook-box-fill.png" alt="Facebook" </li>
<li>
<img src="instagram-fill.png" alt="Instagram" </li>
</div>
</div>
<div class="bottom-page">
<p>copyright ©2022 Geek Yourself Out. Designed by Kimmy Vo</p>
</div>
</footer>
</body>
Just update your Contact-box class like this:
.Contact-box {
position: static;
transform: none;
display: flex;
justify-content: center;
align-items: center;
}
You had set the form to inline-block. I simply removed that and added center text alignment to center the button.
#font-face {
Src: url(customfont/Futuristic.ttf);
font-family: Future;
}
.Contact-box {
position: static;
transform: none;
}
h1 {
margin-bottom: 1rem;
color: red;
text-align: center;
font-size: 40px;
font-family: Future;
}
form {
/* display: inline-block; <--------------------------------------- HERE */
flex-direction: column;
width: 24rem;
gap: 1rem;
margin-left: auto;
margin-right: auto;
text-align: center; /* <----------------------------------------HERE */
}
input,
textarea {
padding: 1.5rem;
background: transparent;
border: 2px solid white;
border-radius: 15px;
width: 400px;
}
textarea {
height: 7rem;
}
button {
width: 8rem;
padding: 1rem;
cursor: pointer;
background: blue;
color: black;
}
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="logo">
<img src="https://via.placeholder.com/95" width="95" />
</div>
<div class="coolname">
<img src="https://via.placeholder.com/105" width="105" />
</div>
<nav>
<ul>
<li class="current-page">Home</li>
<li>About Us</li>
<li>Services</li>
<li>Consultation & Quotes</li>
<li>Contact Us</li>
<li>Client Referrals</li>
<li>Blog</li>
</ul>
</nav>
<br><br>
<h1>Contact Us!</h1>
<div class="Contact-box">
<br><br>
<form style="align:center;">
<input type="text" name="Name" placeholder="First and Last Name" required>
<input type="text" name="Email" placeholder="example#email.com" required>
<input type="text" name="Subject" placeholder="Subject Line" required>
<textarea name="Message" placeholder="Message" required></textarea>
<br><br>
<button type="submit">Send</button>
<br><br>
</form>
</div>
<footer>
<div class="bottom-content">
<h3>Geek Yourself Out</h3>
<p>To get some behind-the-scenes action to staying updated on the latest projects, check out these social media links! All follows, likes, comments, and shares are appreciated. </p>
<div class="socials">
<li>
<img src="facebook-box-fill.png" alt="Facebook" </li>
<li>
<img src="instagram-fill.png" alt="Instagram" </li>
</div>
</div>
<div class="bottom-page">
<p>copyright ©2022 Geek Yourself Out. Designed by Kimmy Vo</p>
</div>
</footer>
</body>
text-align: center; only has an effect on text, but it won't center blocks:
div {
max-width: 50%;
text-align: center;
background: yellow;
padding: 10px;
}
p {
text-align: center;
}
<div>Lorem ipsum dolor.</div>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.</p>
If you want to center blocks, you could use flexbox (see this guide) in combination with justify-content:
div {
width: 100%;
display: flex;
justify-content: center;
}
span {
width: 100px;
background: aqua;
display: block;
}
<div><span> center this </span></div>
So I think it's best to wrap the form in a full-width <div> and setting a maximal width on the form:
div.form-container {
display: flex;
justify-content: center;
}
form {
max-width: 50%
}
/* For smaller devices, 50% is too small. Doing this prevents the form from being "crushed": */
#media (max-width: 800px) {
form {
max-width: 90%;
}
}
And to center the button, you can simply do text-align: center;.
I have an image with some text below it, however, I am trying to get them to align vertically and horizontally in the middle. It must also be responsive to both mobile and web view, is it possible?
Here's what I have tried
<style>
.img-responsive {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
</style>
<div class="container">
<img src="..." class="img-responsive"/>
<h4 style="text-align: center;">Sample Text 1</h4>
<p style="text-align: center;">Sample Text 2</p>
</div>
Try this
Html
<div class="container">
<img src="https://s33.postimg.cc/ud7gljfb3/ripple_Bg.jpg" class="img-responsive"/>
<div class="textblock">
<h4 style="text-align: center;">Sample Text 1</h4>
<p style="text-align: center;">Sample Text 2</p>
</div>
</div>
Css ( 2 ways to make center )
1. modern browser supported
.container {
width: 500px;
height: 500px;
position: relative;
}
.img-responsive {
z-index: -1;
position: absolute;
display: block;
width: 100%;
}
.textblock {
width: 109px; /*need to give width*/
display: inline-table; /*ie not supported*/
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
}
1. IE not supported
.container {
width: 500px;
height: 500px;
position: relative;
}
.img-responsive {
z-index: -1;
position: absolute;
display: block;
width: 100%;
}
.textblock {
width: 109px; /*need to give width*/
height: 100px; /*need to give height*/
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
}
Hope it helps:)
You can use the media object in bootstrap
<div class="media">
<img class="align-self-center mr-3" src=".../64x64" alt="Generic placeholder image">
<div class="media-body">
<h5 class="mt-0">Center-aligned media</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p class="mb-0">Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
The documentation link above show you how to align images in different positions. The grid in Bootstrap4 is based on Flex, which allow you to do many advanced layouts. Check it out.
I have made 3 div in following codes. 1st one has navigation element, 2 other has section element.
If you run the above code you will see border of nav
and both sections. My doubt is that the border of 1st section left
element should be to the right of navigation bar border. But since it
is not there(can be seen by running the code), this implies div "a"
and "b" are overlapping. Am I thinking in the right way?And if I am
right, why CSS is designed this way of overlapping div.
In fact this contradicts the reason of introducing div in CSS.
nav {
float: left;
width: 200px;
border: 1px solid black;
}
section {
border: 3px solid red;
}
<div class="a">
<nav>
<span>nav</span>
<ul>
<li><a target="_blank" href="/default.asp">Home</a>
</li>
<li><a target="_blank" href="default.asp">CSS</a>
</li>
<li><a target="_blank" href="/html/default.asp">HTML</a>
</li>
<li><a target="_blank" href="/js/default.asp">JavaScript</a>
</li>
</ul>
</nav>
</div>
<div class="b">
<section>
<span>section</span>
<p>Notice we have put a clearfix on the div container. It is not needed in this example, but it would be if the nav element was longer than the non-floated section content.</p>
</section>
</div>
<div class="c">
<section>
<span>section</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce
luctus vestibulum augue ut aliquet.</p>
</section>
</div>
Its not actually overlapping. As your red border is 3px wide it seems so. See what happens when I made it 1px.
EDIT
I cleared the float on nav by:
<div style="clear:both"></div>
and now it doesn't overlap. This is expected behaviour while you float elements.
<!DOCTYPE html>
<html>
<head>
<style>
nav {
float: left;
width: 200px;
border:1px solid black;
}
section {
border: 1px solid red;
}
</style>
</head>
<body>
<div class="a">
<nav>
<span>nav</span>
<ul>
<li><a target="_blank" href="/default.asp">Home</a></li>
<li><a target="_blank" href="default.asp">CSS</a></li>
<li><a target="_blank" href="/html/default.asp">HTML</a></li>
<li><a target="_blank" href="/js/default.asp">JavaScript</a></li>
</ul>
</nav>
<div style="clear:both"></div>
</div>
<div class="b">
<section>
<span>section</span>
<p>Notice we have put a clearfix on the div container. It is not needed in this example, but it would be if the nav element was longer than the non-floated section content.</p>
</section>
</div>
Your .a block has no height. Add a clearfix to it
.clearfix:after {
content: "";
display: table;
clear: both;
}
<div class="a clearfix">
//rest of code
The porblem is with float
If you dont want to overlap them. Try flex-box
Here is a demo
nav {
/* float: left; */
height: 100%;
width: 200px;
border:1px solid black;
}
.container{
display: flex;
height: 100%;
}
section {
border: 3px solid red;
}
nav ul{
margin:0;
}
<div class="container">
<div class="a">
<nav>
<span>nav</span>
<ul>
<li><a target="_blank" href="/default.asp">Home</a></li>
<li><a target="_blank" href="default.asp">CSS</a></li>
<li><a target="_blank" href="/html/default.asp">HTML</a></li>
<li><a target="_blank" href="/js/default.asp">JavaScript</a></li>
</ul>
</nav>
</div>
<div class="b">
<section>
<span>section</span>
<p>Notice we have put a clearfix on the div container. It is not needed in this example, but it would be if the nav element was longer than the non-floated section content.</p>
</section>
</div>
</div>
<div class= "c">
<section>
<span>section</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet.</p>
</section>
</div>
When the div element is set to float and the width is set, the div height will ajust to the content inside the div. And that is why it overflows the next div bellow. It is using div "b" to set the height of first row.
Is this what you are after:
https://jsfiddle.net/53q6e9hz/
nav {
float: left;
width: 200px;
border: 1px solid black;
}
section {
border: 3px solid red;
display:block;
}
.b{
width:calc(100% - 202px);
float: left;
}
.row1{
display:inline-block;
}
I've been going through lot of articles about placing a label/legend/text on the border of a div. I've a lot of div where I want to show the different labels exactly like the image shown below:
As I can see in the w3school they say to have a field set and get declare legend to display the texts, but its not working out for me. I have a set of jquery codes which appends the html with the labels :
$('.menu').hover(function () {
$(this).css('border', 'solid 2px #8080ff');
$(this).find('.divlabel').show();
}, function () {
$(this).css('border', 'none');
$(this).find('.divlabel').hide();
});
.divlabel {
float: left;
top: 5px;
right: 10px;
padding: 0px;
background: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="menu">
<div class="divlabel">Menu</div>
<ul class="mainmenu">
<li>...</li>
<li>...</li>
</ul>
</div>
<div>
Its not working as desired, please help out guys with this css.
You can use HTML5 data-* attribute to achieve this. It will save one div element:
body {
font: 14px/20px Arial, sans-serif;
}
.menu {
position: relative;
border: 3px solid #8fdaf9;
padding: 30px 10px;
}
.menu:before {
content: attr(data-title);
background: #8fdaf9;
position: absolute;
padding: 0 20px;
color: #fff;
left: 0;
top: 0;
}
.menu ul {
margin: 0;
}
<div class="menu" data-title="Menu">
<ul class="mainmenu">
<li>Menu Item 1</li>
<li>Menu Item 2</li>
</ul>
</div>
<div>
Below example can help you get started. A CSS only solution
div.wrapper {
position: relative;
border: 2px solid cornflowerblue;
margin-top: 20px;
padding: 20px 10px 10px;
}
div.wrapper label {
color: white;
line-height: 20px;
padding: 0 5px;
position: absolute;
background-color: cornflowerblue;
/* Adjust these values to posiytion the title or label */
top: -10px;
left: 10px;
}
<div class="wrapper">
<label>Menu 1</label>
<div>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna
</div>
</div>
<div class="wrapper">
<label>Menu 2</label>
<div>
Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
</div>
</div>
<div class="wrapper">
<label>Menu 3</label>
<div></div>
</div>
<div class="wrapper">
<label>Menu 4</label>
<div></div>
</div>
<div class="wrapper">
<label>Menu 5</label>
<div></div>
</div>
<div class="wrapper">
<label>Menu 6</label>
<div>Suspendisse dui purus, scelerisque at, vulputate vitae, pretium mattis, nunc. Mauris eget neque at sem venenatis eleifend. Ut nonummy.</div>
</div>
I currently have a site I'm working on ( copying another site as Practice )
This is the site I am trying to re-create
http://www.north2.net/
.
I am almost done, however I cannot position the two side sections(left and right of main image) correctly.
Can anyone help me out?
I have 3 "sections" left, middle, right, all are in a wrapper
I've tried
margin-top,
removing inline-block on the wrappers
...
MY GOAL :
Is to be able to raise the two side bars to my liking, but I don't see how to raise them in any way.
north2.net to see what I mean.
JSFIDDLE
http://jsfiddle.net/abXk4/
Not Important ::
Also, when I position anything, my background image moves and there is a white gap on the bottom of the page, my screen is 1920 x 1080, so any adjustment makes a white space,
I've been fixing this with
padding-bottom: X%;
Is this just something I have to do? Or is it because I coded incorrectly.
HTML
<title> ENTER TITLE </title>
</head>
<body>
<div id='page'>
<!--All of Left Side Bar Contents -->
<div class="swrap">
<div id="logo">
<img src="img/logo_green.png">
</div>
<div id="about">
<aside class="tlb"><p>About Us</p></aside>
<p>Welcome. We are Author, nulla mauris odio, vehicula in, condimentum sit amet, tempus id, metus. Donec at nisi sit amet felis blandit posuere. Aliquam erat volutpat.</p>
</div>
<div id="services">
<aside class="tlb"><p>Services</p></aside>
<ul>
<li>Web Site Dev and Applications </li>
<div class='hr'></div>
<li>CMS</li>
<div class='hr'></div>
<li>Digital Branding and Industry</li>
<div class='hr'></div>
<li>UI Design</li>
<div class='hr'></div>
<li>Social Media</li>
<div class='hr'></div>
<li>User Experience</li>
<div class='hr'></div>
<li>Creative Ingenuity</li>
</ul> </div>
</div>
<!-- Center Content ( main header, main image ) -->
<div class="mwrap">
<!-- Main Nav Above Slider -->
<nav class='mnav'>
<ul>
<li class="m1"><a href='#'>home</a></li>
<li class="m2"><a href='#'>Author</a></li>
<li class="m3"><a href='#'>work</a></li>
<li class="m4"><a href='#'>clients</a></li>
<li class="m5"><a href='#'>contact</a></li>
</ul>
</nav>
<div id="fimg">
<img src="img/fumic_naslovna.jpg">
</div>
<div id="featart">
<article>
<h1>Lorem Ipsum</h1>
<p> Nulla mauris odio, vehicula in, condimentum sit amet, tempus id, metus. Donec at nisi sit amet felis blandit posuere. Aliquam erat volutpat. Cras lobortis orci in quam porttitor cursus. Aenean dignissim. Curabitur facilisis sem at nisi laoreet placerat. Duis sed ipsum ac nibh mattis feugiat. Proin sed purus. Vivamus lectus ipsum, rhoncus sed, scelerisque sit amet, ultrices in, dolor. Aliquam vel magna non nunc ornare bibendum. Sed libero. Maecenas at est. Vivamus ornare, felis et luctus dapibus, lacus leo convallis diam, eget dapibus augue arcu eget arcu.</p>
</article>
</div>
</div>
<div id="rwrap">
<div class="rfc">
<aside class="tlb">Featured Clients</aside>
<p> Nulla mauris odio, vehicula in, condimentum sit amet, tempus id, metus. Donec at nisi sit amet felis blandit posuere. Aliquam erat volutpat. Cras lobortis orci in quam porttitor cursus.</p>
<div class='hr'></div>
<p> Nulla mauris odio, vehicula in, condimentum sit amet, tempus id, metus. Donec at nisi sit amet felis blandit posuere. Aliquam erat volutpat.</p>
</div>
</div>
</div>
</body>
</html>
CSS
body {
background-image: url(img/brown.jpg);
background-repeat:no-repeat;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
background-position:center;
padding-bottom:12%;
color: #fff;
font-weight: bold;
font-size: large;
text-align: left;
}
* {
border-radius: 1px;
}
#page {
margin: 30px 25%;
width: auto;
/* width should be 50% ... 25% on each side, 50% in middle, centered!*/
border: 2px solid black;
}
/*Left Content Begins ------------------ */
.swrap {
width: 23%;
display:inline-block;
/*1% margin on each side */
margin-top: 100px;
}
#logo {
background-color: rgba(0,0,0,.7);
}
#about {
margin: 3px 0;
background-color: rgba(89, 194, 141, 1);
padding: 5%;
}
#about aside {
margin-left: -6% !important;
}
#services {
background-color:rgba(66, 161, 75, .96);
padding: 2%;
margin: 3px 0;
}
.tlb {
background-color: rgba(0,0,0,.6);
width: 75%;
margin: -10px 0 0 -2% !important;
padding-left: 4%;
}
/*Middle Content Begins ------------------ */
.mwrap {
width: 48%;
margin: 0 auto;
/*1% margin on each side for .mwrap*/
display:inline-block;
}
.mnav ul {
list-style:none;
}
.mnav ul li {
display: inline;
font-size: large;
font-weight:bold;
padding: 2px 2%;
border-radius: 1px;
}
.mnav ul li a {
text-decoration: none;
color: #fff;
}
.m1 {background-color:rgba(46, 206, 87, 1); }
.m2 {background-color: rgba(39, 197, 80, 1); }
.m3 {background-color: rgba(70, 182, 99, 1); }
.m4 {background-color: rgba(64, 164, 90, 1);}
.m5 {background-color: rgba(63, 140, 83, 1); }
.mnav ul li:active {
background-color:none !important;
}
.mnav li:hover {
background-color: rgba(0,0,0,.3);
}
#fimg {
width: 100%;
}
#fimg img {
width: 100%;
}
#featart {
margin-top: -10px;
background-color: rgba(64, 164, 90, .9);
padding: 1% 1%;
}
/*Right Content Begins ------------------ */
#rwrap {
width: 23%;
display:inline-block;
/*1% margin on each side */
}
.rfc {
background-color:rgba(66, 161, 75, .96);
padding: 2%;
}
.rfc .tlb {
margin-top: 9px !important;
margin-left: -2.3% !important;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
The easy way is to use position relative position: relative; bottom: [how ever many pixels]
A better (and later much more flexible) way is to change you HTML structure a little bit.
If I were building this site I'd break it into two wrapping divs with three column divs under each of them like here:
<div class="header">
<div class="left-column">
<img id="logo" src="img/logo.png" />
</div>
<div class="middle-column">
<ul class="nav"></ul>
</div>
<div class="right-column">
Put content here if you want it
</div>
</div>
<div class="content">
<div class="left-column">
Content in left column
</div>
<div class="middle-column">
Content in middle
</div>
<div class="right-column">
Content on right
</div>
</div>
Now, use CSS to float those columns just like you did before. The difference with this is you can define a height for the header and the logo and navigation will be much easier to align as they are separate from the other columns.
If you want to get more technical check out CSS Flexbox, it would work well here.
http://philipwalton.github.io/solved-by-flexbox/demos/holy-grail/
set
a position: relative;
bottom: X px;