I'm trying to create a crossmark and a checkmark to align with the text behind. However, while the checkmark seems aligned well, the crossmark is to the top-right. Is there any way I can fix this reliably? I'm not sure if fiddling with margins and paddings would be smart, as that might break once the size of the screen changes.
.list {
font-family: sans-serif;
margin: 1rem 0 1rem !important;
}
.checkmark {
transform: rotate(45deg);
height: 24px;
width: 12px;
border-bottom: 7px solid lightgreen;
border-right: 7px solid lightgreen;
}
.crossmark {
height: 24px;
width: 12px;
position:relative;
}
.crossmark::after{
position: absolute;
content: '';
width: 24px;
height: 0px;
border: solid orange;
border-width: 0 0px 7px 0;
transform: rotate(45deg);
top:0;
}
.crossmark::before{
position: absolute;
content: '';
width: 24px;
height: 0px;
border: solid orange;
border-width: 0 0px 7px 0;
transform: rotate(-45deg);
top:0;
}
.highlighted-err {
background-color: red;
color: white;
border-radius: 0.5rem;
padding: 0.5rem;
}
.highlighted-success {
background-color: darkgreen;
color: white;
border-radius: 0.5rem;
padding: 0.5rem;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="row list" id="type-msg">
</div><div class="row list highlighted-success" id="size-msg">
<div class="col-md-1">
<div class="checkmark"></div>
</div><div class="col-md-11">
<div>Bild-Dateien müssen 600 x 450 Pixel oder größer sein.</div>
</div>
</div><div class="row list highlighted-err" id="aspect-msg">
<div class="col-md-1">
<div class="crossmark"></div>
</div><div class="col-md-11">
<div>Bild-Dateien müssen eine Breite zu Höhe von 3:4 haben.</div>
</div>
</div>
in your crossmark before and after remove
top:0;
replace in the 2 by
top:12px;
You are making rotation 45deg and -45deg. Position element in center (crossmark 24px, so 12px center), and rotate. Transform origin rotate in center center for the element.
Your absolute positioning with top: 0; forced the before and after elements to the top of the parent.
By switching it to top: 50%; and adding translate(0, -50%) to each transform, you effectively center both elements within the parent element.
This will work even if you start changing the values of the fixed widths and heights.
.list {
font-family: sans-serif;
margin: 1rem 0 1rem !important;
}
.checkmark {
transform: rotate(45deg);
height: 24px;
width: 12px;
border-bottom: 7px solid lightgreen;
border-right: 7px solid lightgreen;
}
.crossmark {
height: 24px;
width: 12px;
position:relative;
}
.crossmark::after{
position: absolute;
content: '';
width: 24px;
height: 0px;
border: solid orange;
border-width: 0 0px 7px 0;
transform: translate(0, -50%) rotate(45deg);
top: 50%;
}
.crossmark::before{
position: absolute;
content: '';
width: 24px;
height: 0px;
border: solid orange;
border-width: 0 0px 7px 0;
transform: translate(0, -50%) rotate(-45deg);
top: 50%;
}
.highlighted-err {
background-color: red;
color: white;
border-radius: 0.5rem;
padding: 0.5rem;
}
.highlighted-success {
background-color: darkgreen;
color: white;
border-radius: 0.5rem;
padding: 0.5rem;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="row list" id="type-msg">
</div><div class="row list highlighted-success" id="size-msg">
<div class="col-md-1">
<div class="checkmark"></div>
</div><div class="col-md-11">
<div>Bild-Dateien müssen 600 x 450 Pixel oder größer sein.</div>
</div>
</div><div class="row list highlighted-err" id="aspect-msg">
<div class="col-md-1">
<div class="crossmark"></div>
</div><div class="col-md-11">
<div>Bild-Dateien müssen eine Breite zu Höhe von 3:4 haben.</div>
</div>
</div>
Related
I am working on a HTML/CSS project. I have the following code:
category-arrows.html:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>CSS Arrows</title>
<link rel="stylesheet" type="text/css" href="category-arrows.css">
</head>
<body>
<div class="arrows-container">
<div class="up-arrow"></div>
<div class="category-rank">
<p>2</p>
</div>
<div class="down-arrow"></div>
</div>
</body>
</html>
category-arrows.css:
.up-arrow {
width: 60px;
height: 60px;
border-top: 15px solid #000000;
border-right: 15px solid #000000;
transform: rotate(-45deg);
margin: 50px;
border-radius: 15%;
}
.up-arrow:hover, .down-arrow:hover {
border-top: 15px solid #28bfa6;
border-right: 15px solid #28bfa6;
cursor: pointer;
}
.down-arrow {
width: 60px;
height: 60px;
border-top: 15px solid #000000;
border-right: 15px solid #000000;
transform: rotate(135deg);
margin: 50px;
border-radius: 15%;
position: relative;
top: -105px;
}
.category-rank {
position: relative;
top: 50%;
transform: translateY(-50%);
right: -69px;
margin-top: -36px;
font-size: 60px;
font-family: Helvetica;
}
The result of the above code is the following:
When the number between the arrows is -1, I get the following:
When the number between the arrows is negative (e.g. -1), the text is not fully horizontally centred between the arrows. I am using the CSS right property to centre the text between the arrows. This works fine when the number between the arrows does not have a negative sign in front of it.
I would like the text between the arrows to always be horizontally centred. However, I am not sure what the best way to do this is. Any insights are appreciated.
One solution would be to check if number < 0, and then use str.substring(1) to remove the first character of that number (the minus sign), and then display a minus sign next to it in fixed position in a span for example or whatever.
That way the number would always be centered, and if negative that minus sign would show itself and not move the number itself.
Your layout is all broken if you'd just add borders and some padding you'll see everything is miss aligned.
body * {
border: 1px solid;
padding: 10px;
}
.up-arrow {
width: 60px;
height: 60px;
border-top: 15px solid #000000;
border-right: 15px solid #000000;
transform: rotate(-45deg);
margin: 50px;
border-radius: 15%;
}
.up-arrow:hover,
.down-arrow:hover {
border-top: 15px solid #28bfa6;
border-right: 15px solid #28bfa6;
cursor: pointer;
}
.down-arrow {
width: 60px;
height: 60px;
border-top: 15px solid #000000;
border-right: 15px solid #000000;
transform: rotate(135deg);
margin: 50px;
border-radius: 15%;
position: relative;
top: -105px;
}
.category-rank {
position: relative;
top: 50%;
transform: translateY(-50%);
right: -69px;
margin-top: -36px;
font-size: 60px;
font-family: Helvetica;
}
<div class="arrows-container">
<div class="up-arrow"></div>
<div class="category-rank">
<p>-1</p>
</div>
<div class="down-arrow"></div>
</div>
You should instead relay on the changing element, the p is the one that changes so we align the arrows according to it.
display:inline-flex to the container will make it shrink to fit the widest element which the p tag, and we apply align-items: center; to center horizontally the arrows.
/* remove unnecessary padding and margin */
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.arrows-container {
padding: 20px; /* just to be safe */
display: inline-flex;
flex-direction: column;
align-items: center;
}
.up-arrow {
width: 60px;
height: 60px;
border-top: 15px solid #000000;
border-right: 15px solid #000000;
transform: rotate(-45deg);
border-radius: 15%;
}
.up-arrow:hover,
.down-arrow:hover {
border-top: 15px solid #28bfa6;
border-right: 15px solid #28bfa6;
cursor: pointer;
}
.down-arrow {
width: 60px;
height: 60px;
border-top: 15px solid #000000;
border-right: 15px solid #000000;
transform: rotate(135deg);
border-radius: 15%;
}
.category-rank {
font-size: 60px;
font-family: Helvetica;
}
/* For the red line to show center, Not needed */
.arrows-container {
position: relative;
}
.arrows-container:before {
content: '';
position: absolute;
height: 100%;
width: 2px;
background: red;
top: 0;
}
<div class="arrows-container">
<div class="up-arrow"></div>
<div class="category-rank">
<p>-1</p>
</div>
<div class="down-arrow"></div>
</div>
<div class="arrows-container">
<div class="up-arrow"></div>
<div class="category-rank">
<p>1</p>
</div>
<div class="down-arrow"></div>
</div>
<div class="arrows-container">
<div class="up-arrow"></div>
<div class="category-rank">
<p>58</p>
</div>
<div class="down-arrow"></div>
</div>
I tried cleaning the code a little bit.
So i have one "flipping card" and another bootstrap 4 card side by side like this: (I have edited the image to hide text)
However when this is tested on target mobile screen using chrome's dev consolde, The 2nd Card overlaps the flipping card and completely covers it. like this:
I have put the code inside the container, row and col-md-* like this:
<div class="container">
<div class="row">
<div class="col-md-4">
</div>
....
<div class="col-md-8">
</div>
</div>
</div>
For full refrence, here is my full html and css code:
html:
<!-- start of third block -->
<div class="thirdblock">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card-container">
<div class="card">
<div class="front">
<div class="cover">
</div>
<div class="user">
<img class="img-circle" src="images/...jpg" />
</div>
<div class="content">
<div class="main">
<h3 class="name">.</h3>
<p class="profession">.</p>
<p class="">..
<div class="text-center">
<i class="fa fa-mail-forward"></i> Flip
</div>
</p>
</div>
</div>
</div> <!-- end front panel -->
<div class="back">
<div class="content">
<div class="main">
<p> </p>
<p class="lead">
.</p>
<p> </p>
<br>
<div class="stats-container">
<div class="stats">
<h4>100+</h4>
<p>
Followers
</p>
</div>
<div class="stats">
<h4>10+</h4>
<p>
Following
</p>
</div>
<div class="stats">
<h4>100+</h4>
<p>
Projects
</p>
</div>
</div>
</div>
</div>
</div> <!-- end back panel -->
</div> <!-- end card -->
</div> <!-- end card-container -->
</div> <!-- end col-md-4 -->
<div class="col-md-8">
<div class="card">
<div class="card-body">
<h4> </h4>
<p class="lead">
</p>
<img class="rounded mx-auto d-block" src="images/....png" />
<br>
</div>
</div>
</div>
</div><!-- end row -->
</div> <!-- end container -->
</div>
<!-- end third block -->
And the huge css code:
.thirdblock {
padding-top: 50px;
padding-bottom: 50px;
height: 100%;
font-family: 'Arima Madurai', cursive;
background-image: url("../images/image.jpg");
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.card {
font-family: 'Arima Madurai', Verdana;
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 4px;
color: #444444;
-webkit-box-shadow: 0px 0px 19px 0px rgba(0, 0, 0, 0.16);
-moz-box-shadow: 0px 0px 19px 0px rgba(0, 0, 0, 0.16);
box-shadow: 0px 0px 19px 0px rgba(0, 0, 0, 0.16);
}
/*Flipping Card Code*/
/*Flip Card Starts*/
.btn:hover,
.btn:focus,
.btn:active {
outline: 0 !important;
}
/* entire container, keeps perspective */
.card-container {
-webkit-perspective: 900px;
-moz-perspective: 900px;
-o-perspective: 900px;
perspective: 900px;
margin-bottom: 3px;
}
/* flip the pane when hovered */
.card-container:not(.manual-flip):hover .card,
.card-container.hover.manual-flip .card {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.card-container.static:hover .card,
.card-container.static.hover .card {
-webkit-transform: none;
-moz-transform: none;
-o-transform: none;
transform: none;
}
/* flip speed goes here */
.card {
-webkit-transition: -webkit-transform .5s;
-moz-transition: -moz-transform .5s;
-o-transition: -o-transform .5s;
transition: transform .5s;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
position: relative;
}
/* hide back of pane during swap */
.front,
.back {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
background-color: #FFF;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.14);
}
/* front pane, placed above back */
.front {
z-index: 2;
}
/* back, initially hidden pane */
.back {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
z-index: 3;
}
.back .btn-simple {
position: absolute;
left: 0;
bottom: 4px;
}
/* Style */
.card-container,
.front,
.back {
width: 100%;
border-radius: 4px;
-webkit-box-shadow: 0px 0px 19px 0px rgba(0, 0, 0, 0.16);
-moz-box-shadow: 0px 0px 19px 0px rgba(0, 0, 0, 0.16);
box-shadow: 0px 0px 19px 0px rgba(0, 0, 0, 0.16);
margin-bottom: 50px;
}
.card .cover {
height: 105px;
overflow: hidden;
border-radius: 4px 4px 0 0;
}
.card .cover img {
width: 100%;
}
.card .user {
border-radius: 50%;
display: block;
height: 120px;
margin: -55px auto 0;
overflow: hidden;
width: 120px;
}
.card .user img {
width: 100%;
}
.card .content {
background-color: rgba(0, 0, 0, 0);
box-shadow: none;
padding: 10px 20px 20px;
}
.card .content .main {
min-height: 100%;
}
.card .back .content .main {
height: 100%;
}
.card .name {
font-family: 'Arima Madurai', cursive;
font-size: 22px;
line-height: 28px;
margin: 10px 0 0;
text-align: center;
text-transform: capitalize;
}
.card h5 {
margin: 5px 0;
font-weight: 400;
line-height: 20px;
}
.card .profession {
color: #999999;
text-align: center;
margin-bottom: 20px;
}
.card .fofooter-toter {
border-top: 1px solid #EEEEEE;
color: #999999;
margin: 30px 0 0;
padding: 10px 0 0;
text-align: center;
}
.card .footer-t .social-links {
font-size: 18px;
}
.card .footer-t .social-links a {
margin: 0 7px;
}
.card .footer-t .btn-simple {
margin-top: -6px;
}
.card .header {
padding: 15px 20px;
height: 90px;
}
.card .motto {
font-family: 'Arima Madurai', cursive;
border-bottom: 1px solid #EEEEEE;
color: #999999;
font-size: 14px;
font-weight: 400;
padding-bottom: 10px;
text-align: center;
}
.card .stats-container {
width: 100%;
margin-top: 50px;
}
.card .stats {
display: block;
float: left;
width: 33.333333%;
text-align: center;
}
.card .stats:first-child {
border-right: 1px solid #EEEEEE;
}
.card .stats:last-child {
border-left: 1px solid #EEEEEE;
}
.card .stats h4 {
font-family: 'Arima Madurai', cursive;
font-weight: 300;
margin-bottom: 5px;
}
.card .stats p {
color: #777777;
}
Can someone please help me as in what am i messing up?
just add fixed height for your .card class, because of position absolute on .front and .back classes, card class won't take any height.
.card{
height:362px;
}
Remove the CSS for class
.front,.back
/* position: absolute; */
/* top: 0; */
HOME This is the code I have.
<div class="row">
<div class="col-sm">
</div>
<div class="col-sm">
<p align="center" class="savings-calculator-p">SAVINGS CALCULATOR</p>
</div>
<div class="col-sm">
</div>
</div>
How to make the UI like the below one
Like This
A bit of CSS trickery and you get an almost exact replica of what you are after.
*You can play around with the settings to get the look you want. See the 2 images for examples.
Pure & Simple - Quick & Easy CSS
No external scripts or javaScrtipt required. :)
body {
padding-top: 15px;
}
.myContent {
border: 0.8px solid #ddd;
}
#myPage .savings {
position: relative;
border: 1px solid #ddd;
border-bottom: none;
border-radius: 8px 8px 0 0;
box-shadow: 0 0 4px #ccc;
font-size: 14px;
text-align: center;
font-weight: bold;
color: #777;
font-family: arial;
margin: 0 auto;
padding: 8px 10px 6px 10px;
max-width: 180px;
}
#myPage .savings:after,
#myPage .savings:before {
position: absolute;
left: 50%;
top: 100%;
border: solid transparent;
content: "";
}
#myPage .savings:before {
margin-left: -14px;
border-width: 20px;
border-top-color: #eee;
}
#myPage .savings:after {
border-top-color: #ffffff;
border-width: 16px;
margin-left: -10px;
}
<div id="myPage">
<div class="savings">
SAVINGS CALCULATOR
</div>
<div class="myContent">
</div>
</div>
Try this and you're done...
p.savings-calculator-p {
background-color: #EEE;
width: max-content;
padding: 5px 20px;
margin: auto;
margin-top: 20px;
border-radius: 5px;
position: relative;
filter: drop-shadow(0px 0px 2px rgba(0,0,0,0.4));
}
p.savings-calculator-p:after {
display: block;
content: '';
position: absolute;
top: 70%;
left: 0;
right: 0;
margin: auto;
background: #EEE;
width: 20px;
height: 20px;
z-index: -1;
transform: rotateZ(45deg);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-sm">
</div>
<div class="col-sm">
<p align="center" class="savings-calculator-p">SAVINGS CALCULATOR</p>
</div>
<div class="col-sm">
</div>
</div>
Use this tool to generate a custom css - http://www.cssarrowplease.com/, or use the below code snippet
.arrow_box {
font-size: 12px;
text-align: center;
max-width: 200px;
margin: 0 auto;
padding: 10px;
position: relative;
background: #ffffff;
font-family: sans-serif;
border: 1px solid #cccccc;
}
.arrow_box:after, .arrow_box:before {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.arrow_box:after {
border-color: rgba(255, 255, 255, 0);
border-top-color: #ffffff;
border-width: 10px;
margin-left: -10px;
}
.arrow_box:before {
border-color: rgba(204, 204, 204, 0);
border-top-color: #cccccc;
border-width: 11px;
margin-left: -11px;
}
<div class="arrow_box">
SAVINGS CALCULATOR
</div>
I guess this will be helpful for you.
$(document).ready(function(){
$('.col-sm-4').on('mouseover', function(ev) {
$('.savings-calculator-p').addClass('show');
$('.savings-calculator-p').css('left', ev.clientX - 80 + 'px');
})
$('.col-sm-4').on('mousemove', function(ev) {
$('.savings-calculator-p').css('left', ev.clientX - 80 + 'px');
})
$('.col-sm-4').on('mouseleave', function(ev) {
$('.savings-calculator-p').removeClass('show')
})
})
.row {
position: relative;
display: flex;
}
.col-sm-4 {
flex: 1;
display: flex;
justify-content: center;
margin-top: 50px;
}
.savings-calculator-p {
font-size: 12px;
display: inline-block;
text-align: center;
max-width: 200px;
margin: 0 auto;
padding: 10px;
position: fixed;
background: #ffffff;
font-family: sans-serif;
border: 1px solid #cccccc;
transition: all 0.3s ease;
opacity: 0;
visibility: visible;
}
.show {
opacity: 1;
visibility: visible;
}
.savings-calculator-p:after, .savings-calculator-p:before {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.savings-calculator-p:after {
border-color: rgba(255, 255, 255, 0);
border-top-color: #ffffff;
border-width: 10px;
margin-left: -10px;
}
.savings-calculator-p:before {
border-color: rgba(204, 204, 204, 0);
border-top-color: #cccccc;
border-width: 11px;
margin-left: -11px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<p align="center" class="savings-calculator-p">SAVINGS CALCULATOR</p>
<div class="col-sm-4">
Header 1
</div>
<div class="col-sm-4">
Header 2
</div>
<div class="col-sm-4">
Header 3
</div>
</div>
Use Bootstrap popover and always show it
Since you are already using bootstrap, you should go for popover. It is concise and hence easy to maintain.
$('.popover-visible') .popover('show') .off('click');
<div class="container">
<div class="row pt-5">
<div class="col-sm ">
</div>
<div class="col-sm popover-visible mt-5"
data-container="body"
data-toggle="popover"
data-placement="top"
data-content="SAVINGS CALCULATOR">
<p align="center" class="savings-calculator-p">CURRENT SAVING DONE(R)</p>
</div>
<div class="col-sm">
</div>
</div>
</div>
https://codepen.io/anon/pen/wYJERz
I have the following html structure where I style my titles with an underline and a shadow.
.title {
font-size: 28px;
line-height: 1;
letter-spacing: 0px;
text-shadow: 2px 2px #32c8ff;
text-decoration: underline;
text-underline-position: under;
}
<div class="container">
<div class="content">
<div class="title">MY TITLE
</div>
</div>
</div>
I tried to apply a perspective effect with the following css
.container {
-webkit-perspective: 150px;
perspective: 150px;
}
.content {
-webkit-transform: rotateX(25deg);
transform: rotateX(25deg);
}
<div class="container">
<div class="content">
<div class="title">MY TITLE
</div>
</div>
</div>
As you can see, it works fine on the text but on the underline the shadow is not displayed and the distance from the text (text-underline-position: under;) is ignored.
Is there a way to display the shadow and keep the correct distance of the underline from the text when using the perspective?
You can simulate the underline with the pseudo element before:
.title {
display: inline-block;
font-size: 28px;
line-height: 1;
letter-spacing: 0px;
position: relative;
text-shadow: 2px 2px #32c8ff;
text-decoration: none;
}
.title::before {
border-bottom: 2px solid #000;
bottom: 0;
content: "";
position: absolute;
left: 0;
right: 0;
box-shadow: 2px 2px #32c8ff;
}
See the example here
Another possibility: Fiddle
.title, .subtitle {
font-size: 28px;
line-height: 1;
letter-spacing: 0px;
text-shadow: 2px 2px #32c8ff;
text-align: center;
}
.title {
border-bottom: 2px solid;
box-shadow: 2px 2px #32c8ff;
}
.container {
display: table-cell;
-webkit-transform: rotateX(45deg);
transform: rotateX(25deg);
}
.content {
-webkit-transform: rotateX(45deg);
transform: rotateX(25deg);
}
<div class="container">
<div class="content">
<div class="title">GREENPEACE</div>
<div class="subtitle">THE SURFER</div>
</div>
</div>
Check this out:
https://jsfiddle.net/zzhn5gh7/
.container {
width: 200px;
height: 200px;
border: 1px solid #CCC;
margin: 0 auto 60px;
position: relative;
-webkit-perspective: 600px;
-moz-perspective: 600px;
-o-perspective: 600px;
perspective: 600px;
}
.title {
width: 100%;
height: 100%;
position: absolute;
background: green;
font-size: 35px;
line-height: 1;
letter-spacing: 0px;
text-shadow: 2px 2px #32c8ff;
text-decoration: underline;
text-underline-position: under;
}
#rotate-x .title {
-webkit-transform: rotateX( 45deg);
-moz-transform: rotateX( 45deg);
-o-transform: rotateX( 45deg);
transform: rotateX( 45deg);
}
<div id="rotate-x" class="container">
<div class="title">MY TITLE
</div>
The right solution for me was the following:
.title {
display: inline-block;
position: relative;
font-size: 28px;
line-height: 2.5;
letter-spacing: 0px;
text-shadow: 2px 2px #32c8ff;
text-decoration: none;
}
.title::before {
border-bottom: 4px solid #ffffff;
bottom: 0;
content: "";
position: absolute;
left: 0;
right: 0;
box-shadow: 2px 2px #32c8ff;
margin: 11px 0px;
}
.subtitle {
font-size: 28px;
line-height: 0.7;
letter-spacing: 0px;
text-shadow: 2px 2px #32c8ff;
}
I'm trying to make the div for bootstrap to look like below not sure how you do it with css. The arrow and the section labeleled movies
Please view the pic at https://plus.google.com/+SamuelMuiruri/posts/fMMhNQwPbCm
First of all you have to position the title "Movies" about the description. The arrow is a only a little css magic
HTML:
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="specialbox">
<img src="https://placeimg.com/320/240/tech"/>
<div class="specialbox__description">
<span class="specialbox__title">Movies</span>
<h2>Age of Ultron</h2>
<p>Tony Stark tries ti jumpstart a dormant peace-kepping program...</p>
</div>
</div>
</div>
</div>
</div>
CSS:
.specialbox {
border: 3px solid #ccc;
}
.specialbox img {
width: 100%;
}
.specialbox__description {
position: relative; /* You need this, to position the title element absolute to the description */
padding: 20px 10px;
}
.specialbox__title {
position: absolute;
background-color: yellow;
text-transform: uppercase;
padding: 10px;
border-radius: 10px 10px 0 0;
top: -40px; /* Adjust to the height of the title container */
}
/* Magic described here */
.specialbox__title:after {
position: absolute;
display: block;
content: '';
width: 30px;
height: 30px;
border: 15px solid transparent;
left: 50%;
bottom: -30px;
margin-left: -15px;
border-top: 15px solid yellow;
}
http://jsfiddle.net/ytbtbt1d/
I think you want to create a TRIANGLE edge below the div containg the text -'MOVIES' (see screenshot below)
I have created a code for you here: JSFIDDLE
HTML:
<div>Movies</div>
CSS
div{
position: relative;
display:inline-block;
width: 140px;
padding: 10px;
background:#FFC000;
text-transform: uppercase;
font-size: 24px;
text-align: center;
}
div:after{
position: absolute;
width: 0;
height: 0;
border-bottom: 40px solid rgba(0, 0, 0, 0);
border-right: 40px solid #FFC000;
bottom: -15px;
left: 0;
right:0;
margin:auto;
content: '';
-ms-transform: rotate(135deg); /* IE 9 */
-webkit-transform: rotate(135deg); /* Chrome, Safari, Opera */
transform: rotate(135deg);
}