LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » CSS Codes / HTML-CSS-PHP-JavaScript » Skewed Inline DIV With Straight Background Image and Text Inside DIVs

Skewed Inline DIV With Straight Background Image and Text Inside DIVs

Skewed-Inline-DIV-With-Straight-Background-Image-and-Text-Inside-DIVs
More and more in web design, we find ourselves putting text on top of images. More often than not, this is a dangerous game. Images have dynamic color and lighting and text for the most part is one color. This is often a nightmare for readability and accessibility.

Do you want to show multiple responsive full-height skewed div inline with straight anything, background images, and text inside skewed divs and force them to be straight?

There are many code snippets available online or on many other blogs and websites, but everyone cannot optimize your blog or website, so you need some optimized code snippets. So now checkout out the code snippet for your blog and website that will give you all features for your desired code. Now grab the ready-to-use code and paste it where you want.

Features:

  1. Light Weight.
  2. Pure HTML-CSS.
  3. Cross Browser.
  4. No JQuery Files.
  5. Fully Customizable.
  6. Responsive.

How To Create Simple And Rich Toast-Style Web Notifications In Vanilla JavaScript?

There are a few easy and understandable steps to achieve your desired functionality that we are gonna share below. Follow each step perfectly.

Recommended For You:
How To Encrypt Secure Passwords In New PHP And Store In Database?

CSS:

<style type="text/css">
* {
padding:0;
margin:0;
}
.container {
display: flex;
height: 100vh;
overflow:hidden;
}

.box {
flex: 1;
border: 1px solid;
transform: skew(-25deg);
position: relative;
overflow: hidden;
}

.inner {
transform: skew(25deg);
text-align:center;
color: #FFF;
font-size: 30px;
}
.box:first-child {
margin-left:calc((100% / 5) / -1);
}
.box:last-child {
margin-right:calc((100% / 5) / -1);
}

.box:before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: -60%;
right: -60%;
width: 300%;
transform: skew(25deg);
background-image: var(--i);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
</style>

HTML:

<div class="container">
<div class="box" style="--i:url(https://picsum.photos/400/200/)"><div class="inner">Hello</div></div>
<div class="box" style="--i:url(https://picsum.photos/400/300/)"><div class="inner">Hello</div></div>
<div class="box" style="--i:url(https://picsum.photos/300/200/)"><div class="inner">Hello</div></div>
<div class="box" style="--i:url(https://picsum.photos/400/300/)"><div class="inner">Hello</div></div>
<div class="box" style="--i:url(https://picsum.photos/200/300/)"><div class="inner">Hello</div></div>
</div>

Customization:

No need to customize it. Just copy-paste. Rest edit the code as per comments and need.

Troubleshooting the Errors:

Do it with concentration and patience. Check your all steps again and all codes or scripts. If you find any error you can contact us anytime via comment or better via email, We are always here to help you.

Final Words:

That’s all we have. We hope that you liked this article. If you have any problem with this code in your template then feel free to contact us with a full explanation of your problem. We will reply to you as time allows us If you have any doubts or problems please comment below. We are happy to help you! If you liked this article, Don’t forget to share this with your friends so they can also take benefit from it and leave.

You Like It, Please Share This Recipe With Your Friends Using...

Be the first to write a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *