Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

can't get text to align correct using parallax

Contributor ,
Mar 22, 2018 Mar 22, 2018

Just an fyi, I'm very much a novice at this stuff.

after i type in the code for the .ptext all the text stacks on top of each other. any help would be great.

.ptext{

    position:absolute;

        top:50%;

        width:100%;

    text-align: center;

    color:#000;

    font-size:27px;

        letter-spacing:8px;

    text-transform: uppercase;

   

       

}

Screen Shot 2018-03-22 at 5.01.05 PM.png

<!doctype html>

<html>

<head>

<meta charset="UTF-8">

<title>index</title>

    <link rel="stylesheet" href="css/style.css">

</head>

<body>

    <div class="pimg1">

    <div class="ptext">

        <span class="border">

            Parallax Website

        </span>

        </div>

    </div>

    <section class="section section-light">

        <h2>Section One</h2>       

    <p>

        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias amet eius qui neque non atque, quidem dolorum soluta dolorem obcaecati sunt, placeat quaerat omnis, minus alias nisi! Officia exercitationem odio repellendus, a dolor aliquam eum impedit perspiciatis qui recusandae earum corrupti consequuntur? Excepturi quod quae amet sapiente nulla omnis dolorem aliquam quidem, hic repellat qui repudiandae perspiciatis minus aperiam eum, harum! Repellendus ipsa eaque voluptas, unde ullam corporis cupiditate hic explicabo blanditiis sit aut perferendis ducimus, harum deserunt ipsam! At quas illum earum neque qui voluptatibus voluptate, commodi mollitia pariatur dolore molestiae, cum labore cumque saepe quod id laborum. Voluptates!

        </p>

        </section>

   

        <div class="pimg2">

    <div class="ptext">

        <span class="border">

            Image Two text

        </span>

        </div>

    </div>

   

    <section class="section section-dark">

        <h2>Section Two</h2>       

    <p>

        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias amet eius qui neque non atque, quidem dolorum soluta dolorem obcaecati sunt, placeat quaerat omnis, minus alias nisi! Officia exercitationem odio repellendus, a dolor aliquam eum impedit perspiciatis qui recusandae earum corrupti consequuntur? Excepturi quod quae amet sapiente nulla omnis dolorem aliquam quidem, hic repellat qui repudiandae perspiciatis minus aperiam eum, harum! Repellendus ipsa eaque voluptas, unde ullam corporis cupiditate hic explicabo blanditiis sit aut perferendis ducimus, harum deserunt ipsam! At quas illum earum neque qui voluptatibus voluptate, commodi mollitia pariatur dolore molestiae, cum labore cumque saepe quod id laborum. Voluptates!

        </p>

        </section>

   

    <div class="pimg3">

    <div class="ptext">

        <span class="border">

            Image three text

        </span>

        </div>

    </div>

   

    <section class="section section-dark">

        <h2>Section Three</h2>       

    <p>

        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias amet eius qui neque non atque, quidem dolorum soluta dolorem obcaecati sunt, placeat quaerat omnis, minus alias nisi! Officia exercitationem odio repellendus, a dolor aliquam eum impedit perspiciatis qui recusandae earum corrupti consequuntur? Excepturi quod quae amet sapiente nulla omnis dolorem aliquam quidem, hic repellat qui repudiandae perspiciatis minus aperiam eum, harum! Repellendus

        </p>

        </section>

   

    <div class="pimg1">

    <div class="ptext">

        <span class="border">

            Parallax Website

        </span>

        </div>

    </div>

</body>

</html>

/* CSS Document */

body, html{

    height: 100%;

    margin: 0;

    font-size:16px;

    font-family: "Lato",sans-serif;

    font-weight: 400;

    line-height: 1.8em;

    color: #666;

   

}

.pimg1, .pimg2, .pimg3 {

    position-relative;

    opacity: 0.70;

    background-position: center;

    background-size: cover;

    background-repeat: no-repeat;

   

    /*fixed=parallax

    scroll=fixed*/

   

    background-attachment: fixed;

}

.pimg1{

    background-image: url('../images/image1.jpg');

    min-height: 100%

}

.pimg2{

    background-image: url('../images/image2.jpg');

    min-height:400px

}

.pimg3{

    background-image: url('../images/image3.jpg');

    min-height:400px

}

.section{

    text-align: center;

        padding:50px 80px;

}

.section-light{

    background-color: #f4f4f4;

    color:#666;

   

}

.section-dark{

    background-color: #282E34;

    color:#ddd;

}

.ptext{

    position:absolute;

        top:50%;

        width:100%;

    text-align: center;

    color:#000;

    font-size:27px;

        letter-spacing:8px;

    text-transform: uppercase;

   

       

}

596
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 22, 2018 Mar 22, 2018

I use Bootstrap for responsive layouts and other cool stuff that's included in the framework.  My tutorial is written, not video.   

Translate
Community Expert ,
Mar 22, 2018 Mar 22, 2018

I would avoid absolute positioning like the plague.   Try font-sizes in viewport units.  Below is a demo I did a while ago.

Demo Bootstrap Parallax Template

Tutorial: Bootstrap Parallax Template

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 22, 2018 Mar 22, 2018

i basically copied this code from a youtube vid that i watched about creating parallax backgrounds. everything but the text alignment works.

also, im not using bootstrap. is your video still valid?

thanks

Owen

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2018 Mar 22, 2018

I use Bootstrap for responsive layouts and other cool stuff that's included in the framework.  My tutorial is written, not video.   

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 23, 2018 Mar 23, 2018

thanks Nancy-

how difficult is it to intall bootstrap into DWCC2018?  do you have a tutorial or know of a good one that takes you through the steps?

thanks

Owen

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2018 Mar 23, 2018

Bootstrap is included in DW 2018.  There is nothing to install.

Go to File > New > Starter Templates > Bootstrap Templates.  Select one of the Sample Page layouts and hit the Create button.

CC-StarterPage.jpg

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 23, 2018 Mar 23, 2018
LATEST

perfect.

ill check it out.

thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines