Can't center <p> nested inside of 2 divs and a section - html

I'm trying to center my paragraphs, but having the worst time of trying to do it:
.centerLoginForm {
display: flex;
justify-content: center;
}
.mainContent {
position: relative;
color: white;
width: 60%;
padding: 1.5% 2.5% 0 2.5%;
margin-top: 5%;
background-color: black;
border-radius: 5% 5% 5% 5%;
}
.underHead,
.underHead p {
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
.underHead {
width: 70%;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
<div class='centerLoginForm'>
<section class='mainContent'>
<h1>Welcome to the BYU Idaho Radio Intranet!</h1>
<div class='underHead'>
<p>Computers and computer networks are a funny thing. We interact with them mostly through the internet, which is just a whole bunch of interconnected computers around the world. Well this is an <i>intranet</i>: a local network just like the internet,
only with fewer connected computers.</p>
<p>The purpose of this intranet is to guide through troubleshooting, monitoring critical systems, and station documentation. This site is easy to navigate and you should find all the things you are looking for just by following the navigation links.</p>
<p>This was built to be a living, breathing application. Some dude originally built this, but he welcomes support, ideas, and if somebody wanted to chip in on developing, he would love that too! So please, if you have ideas, thoughts, or skills, share
them! Engineering unfortunately is having fewer and fewer people enter into its field, and needs as many bright minds as it can take and you have a bright mind!</p>
</div>
</section>
</div>
As you can see, the text inside of the <p> tags is is following it's natural position, instead of following what I have in my class .underHead. I've tried text-align, content-align, justify-content, and I just can't figure out a way to center that content.

I think this is what you are looking to do:
.centerLoginForm {
display: flex;
justify-content: center;
}
.mainContent {
position: relative;
color: white;
width: 60%;
padding: 1.5% 2.5% 0 2.5%;
margin-top: 5%;
background-color: black;
border-radius: 5% 5% 5% 5%;
}
.underHead {
display: block;
margin: auto;
width: 70%;
text-align: center;
}
<div class='centerLoginForm'>
<section class='mainContent'>
<h1>Welcome to the BYU Idaho Radio Intranet!</h1>
<div class='underHead'>
<p>Computers and computer networks are a funny thing. We interact with them mostly through the internet, which is just a whole bunch of interconnected computers around the world. Well this is an <i>intranet</i>: a local network just like the internet,
only with fewer connected computers.</p>
<p>The purpose of this intranet is to guide through troubleshooting, monitoring critical systems, and station documentation. This site is easy to navigate and you should find all the things you are looking for just by following the navigation links.</p>
<p>This was built to be a living, breathing application. Some dude originally built this, but he welcomes support, ideas, and if somebody wanted to chip in on developing, he would love that too! So please, if you have ideas, thoughts, or skills, share
them! Engineering unfortunately is having fewer and fewer people enter into its field, and needs as many bright minds as it can take and you have a bright mind!</p>
</div>
</section>
</div>

Related

HTML/CSS - Increased Font-Size Shifts Everything on Page to Left

I'm building a site as a learning exercise. It's aim is to showcase some stories, so the readability of the text is quite important.
For the Home, About and similar pages, the layout I have is fine. However, on the pages with a story on, after I increase the font-size to 1.2rem or above, the paragraphs seem to move everything on the page to the left relative to the position of everything on the other pages.
I've set the widths for all of the containers but it doesn't seem to be making a difference.
I've tried isolating the problem and only the font size makes any difference. If I set it lower than 1.2rem it shifts back to its correct position.
The HTML for one of the story pages and the story pages CSS file are below. Any bootstrap terms are just terms I've adopted, they're not using any Bootstrap styling. Trying to build this from the ground up.
Apologies if this is obvious or any of the below is badly formatted / badly written.
Appreciate any help.
Thank you!
/* Fonts */
/* Montserrat and Raleway */
#import url('https://fonts.googleapis.com/css?family=Montserrat|Raleway');
/* Reset */
* {
box-sizing: border-box;
}
html {
font-size: 16px;
font-family: 'Raleway', sans-serif;
}
/* Components */
.container {
width: 66%;
margin: 0 auto;
}
.jumbotron {
background-color: #ededed;
padding: 6% 10%;
margin: 20px;
}
.jumbotron-header {
font-size: 2rem;
font-family: 'Montserrat', sans-serif;
}
/*block size and height, margins left and right slightly*/
.story-text {
font-size: 1.5rem;
line-height: 1.5;
margin: 20px;
width: 100%;
}
.story-text > p {
width: 100%;
}
.story-subtitle {
font-size: 2rem;
font-weight: 600;
font-family: 'Montserrat', sans-serif;
}
.quote-block {
margin: 50px 300px;
}
.quote {
font-style: italic;
}
.quote-attribution {
font-weight: 700;
}
/* General Styling */
a {
text-decoration: none;
color: black;
}
/* Navigation */
/* Layout */
.nav-area {
display:flex;
height: 40px;
background-color: #ededed;
align-items: center;
}
.nav-links {
display: flex;
flex-grow: 10;
align-items: center;
}
.logo-area {
display: flex;
flex-grow: 1;
justify-content: space-around;
align-items: center;
background-color: #bcbcbc;
height: inherit;
}
/* Styling */
#logo {
font-size: 20px;
font-weight: bold;
}
.nav-links > div {
height: 40px;
line-height: 40px;
}
.nav-links span {
font-size: 20px;
margin: 20px;
line-height: normal;
vertical-align: middle;
}
.nav-links > div:hover {
background-color: #ffffff;
}
/* Mobile */
/* Burger Menu */
.mobile-nav {
display: none;
}
.mobile-menu {
display: none;
}
.mobile-menu > div {
background-color: #ededed;
border: 1px solid #e5e5e5;
padding: 5%;
}
.mobile-menu > div:hover {
background-color: #cecece;
}
/* Navigation */
#media screen and (max-width: 826px) {
.nav-area {
height: auto;
}
.logo-area {
padding: 5%;
}
}
#media screen and (max-width: 700px) {
.nav-links {
display: none;
}
.mobile-nav {
display: block;
margin: 20px;
}
}
#media screen and (max-width: 740px) {
.jumbotron-header {
font-size: 1rem;
}
.story-text {
font-size: 1rem;
}
.story-subtitle {
font-size: 1.2rem;
}
}
<body>
<!-- Navbar -->
<header>
<div class="nav-area container">
<div class="logo-area">
<span id="logo">The Lovecraft Project</span>
</div>
<div class="nav-links">
<div><span>Home</span></div>
<div><span>About</span></div>
<div><span>Stories</span></div>
</div>
<!-- Burger Menu -->
<i class="mobile-nav fas fa-bars"></i>
</div>
</header>
<div class="container">
<!-- Mobile Menu -->
<div class="mobile-menu">
<div>Home</div>
<div>About</div>
<div>Stories</div>
</div>
</div>
<!-- Content -->
<div class="container">
<div class="jumbotron">
<div class="jumbotron-header">
<h1>The Shadow Over Innsmouth</h1>
<hr>
<p>H.P. Lovecraft</p>
</div>
</div>
<div class="story-text">
<p class="story-subtitle">I.</p>
<p>During the winter of 1927–28 officials of the Federal government made a strange and secret investigation of certain conditions in the ancient Massachusetts seaport of Innsmouth. The public first learned of it in February, when a vast series of raids and arrests occurred, followed by the deliberate burning and dynamiting—under suitable precautions—of an enormous number of crumbling, worm-eaten, and supposedly empty houses along the abandoned waterfront. Uninquiring souls let this occurrence pass as one of the major clashes in a spasmodic war on liquor.</p>
<p>Keener news-followers, however, wondered at the prodigious number of arrests, the abnormally large force of men used in making them, and the secrecy surrounding the disposal of the prisoners. No trials, or even definite charges, were reported; nor were any of the captives seen thereafter in the regular gaols of the nation. There were vague statements about disease and concentration camps, and later about dispersal in various naval and military prisons, but nothing positive ever developed. Innsmouth itself was left almost depopulated, and is even now only beginning to shew signs of a sluggishly revived existence.</p>
<p>Complaints from many liberal organisations were met with long confidential discussions, and representatives were taken on trips to certain camps and prisons. As a result, these societies became surprisingly passive and reticent. Newspaper men were harder to manage, but seemed largely to coöperate with the government in the end. Only one paper—a tabloid always discounted because of its wild policy—mentioned the deep-diving submarine that discharged torpedoes downward in the marine abyss just beyond Devil Reef. That item, gathered by chance in a haunt of sailors, seemed indeed rather far-fetched; since the low, black reef lies a full mile and a half out from Innsmouth Harbour.</p>
<p>People around the country and in the nearby towns muttered a great deal among themselves, but said very little to the outer world. They had talked about dying and half-deserted Innsmouth for nearly a century, and nothing new could be wilder or more hideous than what they had whispered and hinted years before. Many things had taught them secretiveness, and there was now no need to exert pressure on them. Besides, they really knew very little; for wide salt marshes, desolate and unpeopled, keep neighbours off from Innsmouth on the landward side.</p>
<p>But at last I am going to defy the ban on speech about this thing. Results, I am certain, are so thorough that no public harm save a shock of repulsion could ever accrue from a hinting of what was found by those horrified raiders at Innsmouth. Besides, what was found might possibly have more than one explanation. I do not know just how much of the whole tale has been told even to me, and I have many reasons for not wishing to probe deeper. For my contact with this affair has been closer than that of any other layman, and I have carried away impressions which are yet to drive me to drastic measures.</p>
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script type="text/javascript" src="../Resources/Scripts/script.js"></script>
</body>
I guess the problem is, whenever you are increasing the font-size it is aligning itself accordingly inside the fixed width that you have provided. So, in order to get the desired layout every time use percentages rather than fixed values.

Zooming in/out inside of window causes image to duplicate

I started doing web development about 3 days ago. I'm trying to learn as much as I can in 3 months, no frameworks or drag and drop tools.
My first website was an attempted remake of csszengarden.com, and yes, it looks much worse, but I've learned a lot.
This is what it looks like at 100% zoom.
http://prntscr.com/jocan3
This is what it looks like at 25% zoom.
http://prntscr.com/jocb3z
The image duplicates, and the text in the corner of the image does not.
How do I fix both of these?
My code is a bit messy (I think), so some tips on that would be appreciated on that too.
body {
margin: 0;
font-family: Verdana, sans-serif;
font-size: 100%;
}
h1 {
margin: 0;
}
p {
word-wrap: break-word;
width: 55%;
line-height: 1.8em;
margin: 0;
}
#endofheader2 {
margin-bottom: 4%;
}
.participation {
position: absolute;
margin-top: 64%;
color: black;
position: absolute;
margin-left: 10%;
}
.headbar {
opacity: 0.7;
color: white;
font-family: Bahnschrift, Verdana, sans-serif;
position: absolute;
width: 100%;
height: 32%;
background-color: black;
background-image: url(../img/garden8.jpg);
object-position: 50% 150%;
object-fit: none;
border-bottom: 1px solid rgba(173, 216, 230, 0.7);
}
.header-3 {
font-size: 28px;
margin-bottom: 0.7%;
}
.header-1 {
font-size: 28px;
margin-bottom: 0.7%;
}
#endofheader-1 {
margin-bottom: 2%;
}
.about {
margin-top: 40%;
color: black;
position: absolute;
margin-left: 10%;
}
.header-2 {
font-size: 28px;
margin-bottom: 0.7%;
}
.theroad {
margin-top: 25%;
color: black;
position: absolute;
margin-left: 10%;
}
.benefits {
margin-top: 84%;
color: black;
position: absolute;
margin-left: 10%;
}
.header-4 {
font-size: 28px;
margin-bottom: 0.7%;
}
#csszengarden {
font-size: 150%;
margin-left: 20%;
margin-top: 4%;
margin-bottom: 0;
}
#headbar h1 {
font-size: 3.2em;
text-transform: uppercase;
}
#beautyofcss {
margin-top: 0;
font-family: "Segoe Script", Verdana, sans-serif;
margin-left: 20%;
}
#nonlineargradient {
position: absolute;
width: 35%;
height: 600%;
background-color: rgba(65, 104, 37, 0.1);
margin-left: 66%;
}
.nonlineargradient-2 {
position: absolute;
width: 100%;
height: 70%;
background-color: rgba(110, 196, 176, 0.4);
margin-top: 60%;
}
.requirements {
margin-top: 98%;
color: black;
position: absolute;
margin-left: 10%;
}
.header-5 {
font-size: 28px;
margin-bottom: 0.7%;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="headbar">
<h1 id="csszengarden">CSS ZEN GARDEN</h1>
<h2 id="beautyofcss">The Beauty of CSS Design</h2>
</div>
<div id="nonlineargradient"></div>
<div class="theroad">
<p class="header-1">THE ROAD TO ENLIGHTENMENT</p>
<p>Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible DOMs, broken CSS support, and abandoned browsers.</p>
<br>
<p>We must clear the mind of the past. Web enlightenment has been achieved thanks to the tireless efforts of folk like the W3C, WASP, and the major browser creators.</p>
<br>
<p id="endofheader-1">The CSS Zen Garden invites you to relax and meditate on the important lessons of the masters. Begin to see with clarity. Learn to use the time-honored techniques in new and invigorating fashion. Become one with the web.</p>
</div>
<div class="about">
<p class="header-2">SO WHAT IS THIS ABOUT?</p>
<p>There is a continuing need to show the power of CSS. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The
HTML remains the same, the only thing that has changed is the external CSS file. Yes, really.</p>
<br>
<p id="endofheader-2">CSS allows complete and total control over the style of a hypertext document. The only way this can be illustrated in a way that gets people excited is by demonstrating what it can truly be, once the reins are placed in the hands of those able to
create beauty from structure. Designers and coders alike have contributed to the beauty of the web; we can always push it further.</p>
</div>
<div class="participation">
<p class="header-3">PARTICIPATION</p>
<p>Strong visual design has always been our focus. You are modifying this page, so strong CSS skills are necessary too, but the example files are commented well enough that even CSS novices can use them as starting points. Please see the CSS Resource
Guide for advanced tutorials and tips on working with CSS.</p>
<br>
<p>You may modify the style sheet in any way you wish, but not the HTML. This may seem daunting at first if you’ve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide.</p>
<br>
<p>Download the sample HTML and CSS to work on a copy locally. Once you have completed your masterpiece (and please, don’t submit half-finished work) upload your CSS file to a web server under your control. Send us a link to an archive of that file and
all associated assets, and if we choose to use it we will download it and place it on our server.</p>
</div>
<div class="benefits">
<p class="header-4">BENEFITS</p>
<p>Why participate? For recognition, inspiration, and a resource we can all refer to showing people how amazing CSS really can be. This site serves as equal parts inspiration for those working on the web today, learning tool for those who will be tomorrow,
and gallery of future techniques we can all look forward to.</p>
</div>
<div class="nonlineargradient-2"></div>
<div class="requirements">
<p class="header-5">REQUIREMENTS</p>
<p>Where possible, we would like to see mostly CSS 1 & 2 usage. CSS 3 & 4 should be limited to widely-supported elements only, or strong fallbacks should be provided. The CSS Zen Garden is about functional, practical CSS and not the latest bleeding-edge
tricks viewable by 2% of the browsing public. The only real requirement we have is that your CSS validates.</p>
<br>
<p>Luckily, designing this way shows how well various browsers have implemented CSS by now. When sticking to the guidelines you should see fairly consistent results across most modern browsers. Due to the sheer number of user agents on the web these
days — especially when you factor in mobile — pixel-perfect layouts may not be possible across every platform. That’s okay, but do test in as many as you can. Your design should work in at least IE9+ and the latest Chrome, Firefox, iOS and Android
browsers (run by over 90% of the population).</p>
<br>
<p>We ask that you submit original artwork. Please respect copyright laws. Please keep objectionable material to a minimum, and try to incorporate unique and interesting visual themes to your work. We’re well past the point of needing another garden-related
design.
</p>
<br>
<p>This is a learning exercise as well as a demonstration. You retain full copyright on your graphics (with limited exceptions, see submission guidelines), but we ask you release your CSS under a Creative Commons license identical to the one on this
site so that others may learn from your work.</p>
</div>
</html>
use the background-repeat property on your headbar and set it to no-repeat
.headbar {
background-repeat: no-repeat;
}

Clickable cards with links within

I am creating content cards which need to be clickable. Clicking on these cards take you to the page where you can see the full content. Additionally, for some users, the cards also have links inside which go through different pages (like to edit or report). You can see the desired design here:
https://jsfiddle.net/4s8b5kb1/1/ (the card would go to more details page).
Looking through older questions, I came across methods that either make the card div clickable by adding an onClick handler or having a persistent 'View More' link. Ideally, I am want to just use plain CSS without wanting to add onClick handlers that do the job of links, and not have a persistent 'View More' button either.
I have also read of strategies where you create a link within a div and then using z-index you can let it act as the link for the entire div, and having other more specific links have higher z-index.
I have tried it but with not much luck. Here is the code so far: https://jsfiddle.net/4s8b5kb1/1/
Any ideas are much appreciated!
I put position: relative on edit class
.edit {
color: indianred;
font-size: 1rem;
z-index: 10;
position: relative;
}
You can check it here:
.parent {
display: flex;
justify-content:center;
align-items:center;
height: 100vh;
}
.card {
height: 200px;
width: 260px;
background: #FFF;
border: 1px solid #FAFAFA;
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.12);
border-radius: 20px;
overflow-y: auto;
padding: 2em;
font-family: Courier New;
font-size: 0.7rem;
cursor: pointer;
position: relative;
}
.card p {
z-index: 10;
}
.edit {
color: indianred;
font-size: 1rem;
z-index: 10;
position: relative;
}
.view {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 1;
opacity: 0;
}
<div class ="parent">
<div class="card">
<a class="edit" href="#edit">EDIT</a>
<a class="edit" href="#edit">REPORT</a>
<p>
For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us. As
we got further and further away, it [the Earth] diminished in size. Finally it shrank to the size of a marble, the most beautiful you can imagine. That beautiful, warm, living object looked so fragile, so delicate, that if you touched it with
a finger it would crumble and fall apart. Seeing this has to change a man. When I orbited the Earth in a spaceship, I saw for the first time how beautiful our planet is. Mankind, let us preserve and increase this beauty, and not destroy it!
</p>
<a class = "view" href = "#view">View</a>
</div>
</div>

Navigation Bar, Image and outline-Image included

I have a few questions:
How can I make the image below not interfere with the navigation bar? I've tried various height adjustments and it doesn't move.
How can I make the text read as a paragraph aligned to the right and the image lower and to the left- in other words the paragraph and image parallel to each other. Would this include JavaScript?
I also need help with the alignment of the H1.
I have only used CSS and HTML so far- I've researched everywhere and can't find my solutions. What makes it hard is I know what I want but don't know the terms used to find the solutions. Any help is appreciated! Here is my CSS code:
body{
background-color: #2F3A3B;
text-align: justify;
width: 800px;
text-decoration: none;
color: white;
font-family:'Oswald', sans-serif;
}
ul {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover{
background-color: #111;
}
h1{
text-align: relative;
}
.circular--portrait {
position: relative;
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
}
.circular--portrait img {
width: 100%;
}
p{
position:relative;
left: 200px;
top: 40px;
}
HTML Code:
<!DOCTYPE html>
<html>
<head>
<title>About Eddie Munoz</title>
<link rel="stylesheet" type="text/css" href="about.css">
</head>
<div class="circular--portrait">
<img src="images/idpic.jpg">
</div>
<body>
<ul>
<li>About</li>
<li>Gallery</li>
<li>Resume</li>
<li>Contact</li>
</ul>
<div class= "column-one">
<p>Eddie Munoz has been creating art from the age of 13. While he was
completing his Bachelors of Applied Science in Human Relations he was
freelancing on the side. Eddie has created numerous character artists.
ljaldjflakjfldjf;lajf;lkjd;</p>
</div>
<div class="column-two">
<h1>What others are saying</h1>
<p>"Eddie is the best young talent I have had the pleasure to work with. He
has a great eye for detail and really finds the fun in whatever project he
is given no matter the size. Eddie strives to learn every nuance of 3D
gaming tech as well as distributing that knowledge once learned. Eddie is an
amazing talent that is bound for superstar status." - Billy Ashlswede, Art
Lead at Riot Games</p>
<p>"Eddie was a highly valued Character Artist with proficiency in many
different modeling programs. He was a very dedicated artist who frequently
helped others and went out of his way to produce additional assets for our
game. Eddie has not only a very technical, but also a very artistic mindset.
All of these qualities make Eddie a great asset to any team." -Kyle Sarvas,
Game Artist/Game Designer</p>
</div>
</body>
</html>
I've made one change to your HTML:
Move circular--portrait just before column-one
And several to your CSS:
Remove text-align: relative; from h1
Remove position: relative; from .circular--portrait
To .circular--portrait set a width of 25% and make it float to left
To p that is descedent of .column-one make float to right and width of 65% (it has to be bellow 75% to float properly)
To column-two make float to left (also works with floating right)
body{
background-color: #2F3A3B;
text-align: justify;
width: 800px;
color: white;
font-family:'Oswald', sans-serif;
}
ul {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover{
background-color: #111;
}
.circular--portrait {
margin-top: 50px;
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
}
.circular--portrait img {
width: 100%;
}
.circular--portrait {
width: 25%;
float: left;
}
.column-one p{
width: 65%;
float: right;
margin-top: 150px;
margin-left: 10px;
}
.column-two {
float: left;
}
<!DOCTYPE html>
<html>
<head>
<title>About Eddie Munoz</title>
<link rel="stylesheet" type="text/css" href="j.css">
</head>
<body>
<ul>
<li>About</li>
<li>Gallery</li>
<li>Resume</li>
<li>Contact</li>
</ul>
<div class="circular--portrait">
<img src="http://pngimg.com/uploads/face/face_PNG5660.png">
</div>
<div class= "column-one">
<p>Eddie Munoz has been creating art from the age of 13. While he was
completing his Bachelors of Applied Science in Human Relations he was
freelancing on the side. Eddie has created numerous character artists.
ljaldjflakjfldjf;lajf;lkjd;</p>
</div>
<div class="column-two">
<h1>What others are saying</h1>
<p>"Eddie is the best young talent I have had the pleasure to work with. He
has a great eye for detail and really finds the fun in whatever project he
is given no matter the size. Eddie strives to learn every nuance of 3D
gaming tech as well as distributing that knowledge once learned. Eddie is an
amazing talent that is bound for superstar status." - Billy Ashlswede, Art
Lead at Riot Games</p>
<p>"Eddie was a highly valued Character Artist with proficiency in many
different modeling programs. He was a very dedicated artist who frequently
helped others and went out of his way to produce additional assets for our
game. Eddie has not only a very technical, but also a very artistic mindset.
All of these qualities make Eddie a great asset to any team." -Kyle Sarvas,
Game Artist/Game Designer</p>
</div>
</body>
</html>

Webpage won't resize properly

I am attempting to create a business webpage with a two column design. I am trying to have an about us section on one side with some bullets underneath of it. It looks good in the browser in full window view, but when I resize the browser window, my text gets all jumbled and stacked over itself. I am using divs and a container, along with % to place things, but nothing I have tried is working. Any ideas?
Here is the html:
<div class = "aboutuscontainer">
<div class = "abouthead"><h2>About us:</h2></div>
<div class = "aboutinfo"><p>Codes' Decoding is an independant web design company with the consumer's best interests in mind. Created in 2015, we strive to provide only the best in customer satisfaction and web reliability. Since our company is independant, we have the ability to interact directly with the client to offer them the most enjoyable experience possible.</p></div>
<div class = "qualityhead"><h4>Quality:</h4></div>
<div class = "qualityinfo"><p>Here at Codes' Decoding we offer only the highest quality in website design. If you aren't happy, you don't pay. We guarantee you'll love your new site, or your money back!</p></div>
<br>
<div class = "valuehead"><h4>Value:</h4></div>
<div class = "valueinfo"><p>When you work with Codes' Decoding you can be assured that you are receiving the best value on the market. Staying independant keeps us in control of our rates and allows us to keep them low for our valued customers.</p></div>
<br>
<div class = "servicehead"><h4>Service:</h4></div>
<div class = "serviceinfo"><p>Our team at Codes' Decoding is 100% dedicated to making sure your experience is perfect. We are there to answer any questions that you may have and our knowledgable team will ensure you have a smooth experience.</p></div>
</div>
And here is the css:
.aboutuscontainer {
position: relative;
top: 55px;
left: 0%;
border-right: dotted yellow 1px;
max-width: 51.5%;
height: 100%;
}
.abouthead {
position: absolute;
color: yellow;
}
.aboutinfo {
position: absolute;
color: white;
top: 90%;
left: 0px;
line-height: 1.5em;
}
.qualityhead {
position: absolute;
color: yellow;
top: 370%;
left: 2%;
}
.qualityinfo {
position: absolute;
color: white;
top: 370%;
left: 13%;
line-height: 1.5em;
}
.valuehead {
position: absolute;
color: yellow;
top: 570%;
left: 2%;
}
.valueinfo {
position: absolute;
color: white;
top: 570%;
left: 13%;
line-height: 1.5em;
}
.servicehead {
position: absolute;
color: yellow;
top: 790%;
left: 2%;
}
.serviceinfo {
position: absolute;
color: white;
top: 790%;
left: 13%;
line-height: 1.5em;
}
There was enough changes / suggestions that I thought it was worthwhile to create a fiddle for you: https://jsfiddle.net/aaenyenq/
Please note the major revisions to the code:
Rather than absolute, use relative positioning.
Rather than left / top, allow things to flow, and use some widths.
Get the desired left / right arrangement with a method such as display: inline-block or float: left (I tend to prefer display: inline-block).
Simplify the code. Eliminate unnecessary divs (such as around the h2 and h4 elements), and use container classes and more generic markup.
Removed <br> tags. You should never use them for spacing. Use margins / padding instead.
Simplified / revised HTML:
<div class = "aboutuscontainer">
<h2>About us:</h2>
<div class="aboutinfo"><p>Codes' Decoding is an independant web design company with the consumer's best interests in mind. Created in 2015, we strive to provide only the best in customer satisfaction and web reliability. Since our company is independant, we have the ability to interact directly with the client to offer them the most enjoyable experience possible.</p></div>
<div class="listitem">
<h4>Quality:</h4>
<div><p>Here at Codes' Decoding we offer only the highest quality in website design. If you aren't happy, you don't pay. We guarantee you'll love your new site, or your money back!</p></div>
</div>
<div class="listitem">
<h4>Value:</h4>
<div><p>When you work with Codes' Decoding you can be assured that you are receiving the best value on the market. Staying independant keeps us in control of our rates and allows us to keep them low for our valued customers.</p></div>
</div>
<div class="listitem">
<h4>Service:</h4>
<div><p>Our team at Codes' Decoding is 100% dedicated to making sure your experience is perfect. We are there to answer any questions that you may have and our knowledgable team will ensure you have a smooth experience.</p></div>
</div>
</div>
Simplified CSS:
.aboutuscontainer {
position: relative;
margin-top: 55px;
left: 0%;
border-right: dotted yellow 1px;
max-width: 51.5%;
height: 100%;
}
.aboutuscontainer h2 {
color: yellow;
}
.aboutinfo {
color: white;
line-height: 1.5em;
}
.listitem h4 {
display: inline-block;
vertical-align: top;
width: 20%;
color: yellow;
}
.listitem div {
display: inline-block;
vertical-align: top;
width: 78%;
color: white;
}
NOTE: IF you want different spacing for different sections, you can easily just add a class to the listitem div element, then address the different spacing like so:
(Assuming you added a class "service" - <div class="listitem service">):
.listitem.service h4 {
width: 25%;
}
.listitem.service div {
width: 73%;
}
Try not to use position absolute. I fixed some css for you here. I used float left, and % on the width.
https://jsfiddle.net/gefp9bnd/
.qualityhead {
color: yellow;
width: 30%;
float:left;
}
Hope that helps.