Designing unique custom border shapes using CSS

Is there a way to achieve this design using CSS?

See an example

Answer №1

Check out this cool demonstration of a paper folding effect created with CSS!

The secret lies in the clever use of box shadow, especially when applied using the :before pseudo-element.

HTML

<div class="note">

</div>

CSS

.note {
  position: relative;
  width: 30%;
  padding: 1em 1.5em;
  margin: 2em auto;
  color: #fff;
  background: #97C02F;
  overflow: hidden;
}

.note:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 16px 16px 0;
  border-style: solid;
  border-color: #fff #fff #658E15 #658E15;
  background: #658E15;
  box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
}

See it in action on Codepen https://codepen.io/Washable/pen/BJqMJd

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I'm experiencing some compatibility issues with my script - it seems to be functioning correctly on desktops but not on mobile

Below is a script I've implemented on an html page to toggle the visibility of divs based on user interaction. <script> $(document).ready(function(){ $("#solLink").click(function(){ $(".segSlide").hide(), $(".eduSlide").hide ...

Adjust the Number of Grid Columns in a Row with Bootstrap 4

How can I customize the grid-columns for a single .row in Bootstrap 4? Despite my efforts to find a solution in the documentation and forums, I haven't been successful. My goal is to create a grid with either 10 or 5 columns specifically for certain ...

Is there a way to prevent links from opening in an iframe and have them open in the main window instead?

Imagine you have an iframe on your webpage: <iframe style="border-radius:15px;" width="190" height="450" frameborder="0" scrolling="no" marginheight="5" marginwidth="10" src="../img/interactive_map/interactive_sverige.htm"> </iframe> ...

How can you make an element appear when clicking and then disappear with a second click?

Having a bit of an issue here. When I click on the menu button "x," it triggers an onclick event that opens/displays an element. All good so far. But now, I want to click the same menu button "x" to close that same element, and that's where I'm s ...

Tips for creating an expandable div with floated content

I am looking to create a flexible div that expands based on its content. Inside this div, there are two floated left divs with fixed widths. These inner divs should also expand according to their text content. To clear the floats, there is another div wi ...

Having trouble applying CSS styles to a class using Material UI withStyle? If you're finding that withStyle isn't working as

Check out this code snippet: import { withStyles, MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import classNames from 'classnames'; const styles = theme => ({ myGridStyle:{ '&:.my-row-s ...

Why Isn't the Element Replicating?

I've been working on a simple comment script that allows users to input their name and message, click submit, and have their comment displayed on the page like YouTube. My plan was to use a prebuilt HTML div and clone it for each new comment, adjustin ...

Move the DIV element to a static section within the DOM

In my Vue app, I have implemented methods to dynamically move a DIV called 'toolbox' to different sections of the DOM. Currently, the DIV is positioned on the bottom right of the screen and remains static even when scrolling. My goal is to use t ...

Customizing media queries, Overriding styles from parent elements

Currently tackling a responsive website design challenge where I'm dealing with conflicting styles in media queries and parent css. Here's the CSS from the parent style sheet: .sec1 p { text-align: left; width: 55%; margin-left: 8%; float:lef ...

The mechanics of citing two different stylesheets

Just delving into the world of HTML and I'm attempting to link 2 items with href. Surprisingly, I don't receive an error message, but my style.css file refuses to cooperate. Any suggestions? <link rel="stylesheet" href="https://maxcdn.bootstr ...

Require that double-width unicode symbols are displayed as double-width in Markdown or CSS

I am seeking a solution to manage the visual width of double-width unicode characters like the LARGE ORANGE SQUARE ...

Ways to update the hamburger menu icon after it has been clicked

I am trying to create a hamburger style menu where the icon changes to a cross when clicked. How can I achieve this effect using JavaScript? Here is the HTML structure: <ul class="navigation"> <li class="nav-item"><a href="#">Home&l ...

Center items in a Bootstrap collapsed menu

I have put together a bootsrap page with a collapsible search bar. I am looking to make some modifications to it. My first goal is to expand the width and center the bar only when in the collapsible view. When the size decreases to &ap ...

In Bootstrap 4, what is the best way to align and space out form input fields horizontally?

When I use justify-content:center on the row containing the form, it remains positioned above "New Task." Additionally, there is a "+" button following the last input field: <head> <base target="_top"> <link rel="stylesheet" href="htt ...

Is there an issue with the CSS styling causing the IE7 button to not display correctly?

While testing my website in IE7, I noticed that the orange link box for create account is not displaying properly. The bottom of the orange rectangle appears to be cut off. Is there a CSS solution to fix this issue? If you have IE9, you can view this by go ...

How to dynamically style NavLink using a variable in react-router-dom with Emotion?

Is there a way to extract styles to a variable when using react-router-dom's NavLink activeStyle prop? I want to avoid repeating the same styles without using a css file. Ideally, I would prefer to achieve this using Emotion, but if that's not f ...

Troubleshooting issue: Inability to assign classes to child elements within divs of a designated class

Currently, I am facing an issue while attempting to insert divs into multiple divs that share a common class called ".description". My goal is to assign a unique class to each internal div, but for some reason, this only seems to work for the first div w ...

Issue with text-nowrap not functioning as intended within Bootstrap 4.5 table cells

Is there a way to eliminate the space between two columns in my layout? I want to get rid of the highlighted space below. I attempted using text-nowrap, but it didn't achieve the desired result. <link href="https://stackpath.bootstrapcdn.co ...

Weird gap between image and div element (CSS)

I often encounter an issue with divs and images not nesting flush against each other due to spaces. It's a minor problem, but it can be frustrating. Currently, I'm struggling with the following code. The second div (class Shadow2) contains an im ...

Html elements overlapping due to incorrect positioning

I'm having an issue with my div elements on a web page. Despite them being set up separately, they all end up positioned underneath the first div created (SiteFullControl). Is there any solution to prevent this from happening? <div id="SiteFullCo ...