Avatar of codelevel

asked on 

ribbon css

ribbon is not wrapping the box properly. the box needs to go inside the ribbon. please help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.ribbon {
	font-size: 16px !important;
	width: 100%;
	position: relative;
	background: blue;
	color: #000;
	padding: 10px;
	margin: 0;
.ribbon .ribbon-content:before {
	content: "";
	position: absolute;
	display: block;
	border-style: solid;
	border-color: gray transparent transparent transparent;
	bottom: -1em;
.ribbon .ribbon-content:before {
	left: 0;
	border-width: 1em 0 0 1em;
.non-semantic-protector {
	position: relative;
	z-index: 1;
.box {
	border:1px solid gray;
<h1 class="ribbon"> <strong class="ribbon-content">Lorem Ipsum</strong> </h1>
<div class="box"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>

Open in new window


Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon