How can I create design similar to this? (One grid with two columns splitted in half with images as backgrounds and text over it)?

Viewed 28

I have seen design on the internet like this:

Design I want to implement

And I am trying to implement design similar to this on my web-page. I've successfully implemented some parts but some of them I simply don't know how, perhaps, first problem is the width - as you can notice on the right side of the row it's not full-width (there's blank space between scrollbar and row), the second thing is the text placement - whatever I do I can't achieve the wanted layout - I did got it once, but when I inspected it and opened device toolbar my text was gone, so officially the picture and code I will provide are current status of how it looks:

How it looks right now

Code:

<div class="row" style="
width: 100%;
height: 656px;>
<div class="col-md-12 col-sm-12 col-xs-12 col-lg-6 img-first">
    <h1 class="text-center">Heading</h1>
    <button class="btn btn-secondary text-end" type="button"></button>
</div>
<div class=" col-md-12 col-sm-12 col-xs-12 col-lg-6 img-secondary">
    <h1 class="text-center">Heading</h1>
    <button class="btn btn-secondary text-end" type="button"></button>
</div>

CSS:

.row {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}
*, ::after, ::before {
    box-sizing: border-box;
}
div {
    display: block;
}
body {
    color: #797979;
    background: #ffffff;
    font-family: 'Montserrat', sans-serif;
}
body {
    margin: 0;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: left;
    background-color: #fff;
}
:root {
    --blue: #007bff;
    --indigo: #6610f2;
    --purple: #6f42c1;
    --pink: #e83e8c;
    --red: #dc3545;
    --orange: #fd7e14;
    --yellow: #ffc107;
    --green: #28a745;
    --teal: #20c997;
    --cyan: #17a2b8;
    --white: #fff;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --primary: #007bff;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --font-family-sans-serif: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
    --font-family-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
html {
    font-family: sans-serif;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
*, ::after, ::before {
    box-sizing: border-box;
}
*, ::after, ::before {
    box-sizing: border-box;
}
.img-first{
    background-image: url(../img/about.jpg);
}

    .img-secondary{
        background-image: url(../img/about.jpg);
    }

Keep in mind that I am using Bootstrap 4.4.1, Bootstrap's reboot and jQuery 3.6.1 (of course there are some other libraries, but they're not connected to this one)

0 Answers
Related