Click here to Skip to main content
16,022,069 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to make my web page look like my canvas design below. however, I got the second image beneath that as my result

Shared album - Samuel Zev - Google Photos[^]

my result is below
Shared album - Samuel Zev - Google Photos[^]

This is my codepen work for the design below
https://codepen.io/Samuel-Christian-the-looper/pen/poXeQmX[^]

If any of you here know how to fix my errors please answer back and give me the correct codes. So far I can make the alignment of the page but the background image and the picture of the man won't appear. please tell me how to fix it thank you

What I have tried:

i have tried adding additional css attributes to make the background of the container of the image of the man as 'none' to allow the background image to appear but it has not worked
Posted

1 solution

It's hard for me to see the actual output now because you have put a file link in a codepen source, but the most obvious thing was that you had the div for the text outside the containing div for the image. I moved it inside the text container like this:
HTML
<!doctype html>
<html>
    <head>
     <link href="file:///C:/xampp/htdocs/templatemo_591_villa_agency/styles.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div style="display: flex;">
            <div class="about-us-image">
                <img class="about-image"
                src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8eIdDmzLY1w6wIbExqOKvBLUV4gSgZn8v2g&s"
                 alt="smiling-handsome-asian-manager-with-modern-device">
                </img>
            <div class="about-us-text">
                <h2><h2 style="color: #56aeff;">Who We Are</h2>
                <p>With more than a decade of experience, we are a trusted team of business and financial planners to help you start your business or retirement in Bali, Indonesia and other islands</p>
            </div>
            </div>
        </div>
    </body>
</html>
Next, I added the following CSS for about-us-text.
CSS
.about-us-text {
   position: absolute;
   top: 50%;
   left: 0;
   transform: translate(0, -50%);
   text-align: left;
   padding: 20px;
   width: 50%;
}
 
Share this answer
 
Comments
schmueller 6-Aug-24 23:11pm    
@pete O' Hanlon. i just implemented your suggestions but it made the text move further down and nbot in ghe right place, this is what it looks like now : https://photos.app.goo.gl/P8zAC3HeY9dw1okc6
Pete O'Hanlon 7-Aug-24 3:18am    
My example was just to give you an idea of what you would need to play around with. As I said, I didn't have your source image so I wasn't going to be able to lay it out exactly for you. By playing around with the transform and the left margin, you should be able to achieve what you want. It might be something like this:
.about-us-text {
position: absolute;
top: 50%;
left: 750px;
transform: translate(0, 50%);
text-align: left;
padding: 20px;
width: 30%;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900