On this page the box-shadow style doesn't seem to appear, however this has only been an issue since the hyperlinks have been added. Please see the code.
The box-shadow seems to work fine in Chrome and this issue is mainly in Internet Explorer.
The box-shadow is around the DIV ID="container".
Thanks for your help!
Here is the HTML for the page..
`<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div id="container">
<div id="header">
<div id="logo">
<img src="images/logo.png">
</div>
<div id="title">
<h1>FOOTBALL MANAGER</h1>
<h2>HOME</h2>
</div>
</div>
<div id="nav">
Home
How To Install
Where To Buy
About Us
Contact Us
</div>
<div id="mheading">
<h4>Heading</h4>
</div>
<div id="fmlogo">
<p>fmlogo</p>
</div>
<div id="footer">
<span>
Copyright 2013 Top Notch Multi-Media
</span>
<span id="update">
Site last updated at 22:15 23 November 2013
</span>
</div>
</div>
</body>
</html>
`
And the CSS..
'
#charset "utf-8";
body {
height:1100px;
background-color:#999; /*needs defining in house style */
margin:0px;
padding:0px;
}
h1 {
font-family: Verdana;
font-size: 53px;
text-shadow: 1px 1px 7px #000;
}
h2 {
font-family:Verdana;
font-size:35px;
text-shadow: 1px 1px 7px #000;
}
h3 {
font-family: Verdana;
font-size: 20px;
}
h4 {
font-family:Verdana;
font-size:35px;
margin: 0px;
}
#container {
width:950px;
height:1100px;
margin:0 auto;
background-color:#FFF;
border-style:solid;
border-width:1px;
border-color:#000;
/*order goes Horizontal offset, Vertical offset, Blur radius, Spread distance, Color */
box-shadow:0px 0px 100px 10px #000;
}
#header {
position:relative;
height:170px;
background-color: #30A7BF;
margin:0px auto;
padding: 1px;
}
#title {
position:absolute;
top: 15px;
left: 315px;
}
#nav {
position:relative;
height: 60px;
margin: 0 auto;
background-color:#CF6;
border-style: solid;
border-color: black;
border-bottom-width:2px;
border-top-width:2px;
border-right-width:1px;
border-left-width:1px;
text-align: center;
}
a {
position: relative;
top: 3px;
display: inline-block;
margin: -3px;
height: 56px;
width: 188px;
background-color: #E39734;
border-style: solid;
border-width: 2px;
border-color: #000;
text-align: center;
font-family: Verdana;
font-size: 20px;
line-height: 55px;
}
#button {
position: relative;
top: 3px;
display: inline-block;
margin: -3px;
height: 56px;
width: 188px;
background-color: #E39734;
border-style: solid;
border-width: 2px;
border-color: #000;
text-align: center;
font-family: Verdana;
font-size: 20px;
line-height: 55px;
}
.button:hover {
background-color: #BD7E2D;
}
a:link {
text-decoration: none;
color: #000;
}
a:visited {
text-decoration: none;
color: #000;
}
a:hover {
text-decoration: underline;
color: #636363;
}
#logo {
position:absolute;
height:130px;
width:340px;
top:17px;
left: -10px;
border-style: solid;
border-width:0px;
border-color:black;
}
img {
width: 100%;
}
#mheading {
position:relative;
top: 10px;
left: 5px;
width: 940px;
height: 50px;
border-style: solid;
border-width: 1px;
border-color: #000;
text-align:center
}
#fmlogo {
position: relative;
margin: 0px;
top: 649px;
margin: 0 auto;
width: 940px;
height: 100px;
border-style: solid;
border-color: #000;;
border-width: 1px;
text-align: center;
}
#footer {
position: relative;
margin: 0px;
top: 659px;
width: 940px;
height: 30px;
background-color: #9F3;
border-style: solid;
border-color: black;
border-top-width: 1px;
border-right-width: 0px;
border-bottom-width: 1px;
border-left-width: 0px;
padding-left: 5px;
padding-right:5px;
padding-top: 20px;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}
#update {
float: right;
}
'
What version of IE are you using? If it's IE 9 or below you have to use the following within your container class css declaration:
border-collapse: separate;
Look the answer I found here:
http://blog.mi-ernst.de/2013/04/06/ie9-ie10-css-shadow-not-rendered/
Yesterday I got the problem that IE does not render the box-shadow
property. After a while a figgured out that the property
“border-collapse: collapse;” for a surrounding table prevents the
rendering. I got the property inherited from a stylesheet of a JS
Framework. After manipulating my css to the following configuration:
.shadowed {
-moz-box-shadow: 0 0 5px 5px #DDD;
-webkit-box-shadow: 0 0 5px 5px #DDD;
box-shadow: 0 0 5px 5px #DDD;
border-collapse: separate;
}
Related
I am trying to create the below layout.
This what I have tried so far to make it working but stuck with the Bottom text width and Image alignment.
.page {
margin-bottom: 5px;
border: 1px solid #DEDEDE;
}
.landscape {
height: 8.2in;
font-size: 10px;
position: relative;
page-break-after: always;
/* page-break-inside: avoid; */
font-family: Verdana;
}
.bp-coverpage-3 {
width: 100%;
height: 100%;
}
.bp-coverpage-3 .bp-coverpage-header {
width: 100%;
height: 3.2in;
}
.bp-coverpage-3 .LogoImageSize {
max-height: 1.6in;
max-width: 3.1in;
}
.bp-coverpage-3 .bp-coverpage-header > .header-section-top {
width: 100%;
padding-top: 5%;
}
.bp-coverpage-3 .bp-coverpage-header .client-tag-line {
float: right;
margin-right: 25px;
}
.bp-coverpage-3 .bp-coverpage-header .header-section-bottom {
width: 100%;
padding-top: 10%;
}
.bp-coverpage-3 .bp-coverpage-content {
width: 100%;
border:1px solid #999;
font-family: Manrope SemiBold !important;
background: url(https://as2.ftcdn.net/v2/jpg/04/38/64/95/1000_F_438649569_DsSHTkasH6GqqQXwu7FbRG0OMHstAc2D.jpg) no-repeat bottom -120px right -170px ;
background-size: 80%;
}
.bp-coverpage-3 .content-section-top {
background:transparent;
}
.bp-coverpage-3 .content-section-bottom {
background-color:transparent;
}
.bp-coverpage-3 .bp-coverpage-content .report-name-container {
padding: 0px 0px 0px 40px;
background: #61626B;
width:35%;
position:relative;
z-index:1;
}
.bp-coverpage-3 .bp-coverpage-content .report-name-container:after {
content:'';
border-bottom: 140px solid #61626B;
border-left: 120px solid transparent;
border-right: 120px solid transparent;
position:absolute;
bottom:0;
right:-80px;
z-index:-1;
}
.bp-coverpage-3 .bp-coverpage-content .report-name-container:before {
content:'';
border-top: 90px solid #61626B;
border-left: 120px solid transparent;
border-right: 120px solid transparent;
position:absolute;
top:0;
right:-80px;
z-index:-1;
}
.bp-coverpage-3 .report-name-container > .report-name {
font-size: 32px;
font-weight: bold;
color:#FFFFFF;
font-family: 'Manrope SemiBold';
word-break: break-word;
width:2.8in;
height:1.5in;
display: table-cell;
vertical-align:middle;
}
.bp-coverpage-3 .bp-coverpage-content .content-section-bottom .bottom-shape {
padding: 0px 0px 0px 40px;
background: #61626B;
width:calc(40% + 25px);
position:relative;
z-index:1;
background:#E7E7E7;
}
.bp-coverpage-3 .bp-coverpage-content .content-section-bottom .bottom-shape:after {
content:'';
position:absolute;
border-left: 80px solid #E7E7E7;
border-top: 81px solid transparent;
border-bottom: 0px solid transparent;
top:0;
left:100%;
z-index:-1
}
.bp-coverpage-3 .bp-coverpage-content .account-name {
padding: 15px 0px 0px 0px;
font-size: 20px;
font-weight: bold;
font-family: Manrope SemiBold !important;
}
.bp-coverpage-3 .account-name > span {
width: 4.9in;
display: inline-block;
word-break: break-word;
}
.bp-coverpage-3 .bp-coverpage-content .report-date {
padding: 10px 0px 15px 0px;
font-size: 20px;
font-weight: bold;
font-family: Manrope SemiBold;
}
.bp-coverpage-3 hr {
max-width: 52px;
margin-left: 100px;
}
.bp-coverpage-3 > .bp-coverpage-footer {
color: #5B5C64;
font-family: Manrope SemiBold;
}
.bp-coverpage-3 .bp-coverpage-footer > .footer-text {
width: 93%;
display: inline-block;
padding: 20px 20px 20px 20px;
font-size: 12px;
font-weight: bold;
text-align: center;
position: absolute;
bottom: 0;
font-family: Manrope SemiBold;
}
<html lang="en" class="" style="">
<head>
<meta charset="utf-8">
<title>Print Portal</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Manrope&display=swap" rel="stylesheet">
<style>
#import url(https://fonts.googleapis.com/css2?family=Manrope&display=swap);
</style>
</head>
<body>
<div>
<div id="Report_1_Page_1" class="page landscape" style="height:8.2in !important; width:11in !important;">
<div class="bp-coverpage-3">
<div class="bp-coverpage-header">
<div class="header-section-top">
</div>
<span class="client-tag-line"> <img class="LogoImageSize" src="https://static4.depositphotos.com/1020822/359/v/950/depositphotos_3595189-stock-illustration-abstract-security-logo.jpg" alt="Logo"> </span>
<div class="header-section-bottom"></div>
</div>
<div class="bp-coverpage-content">
<div class= "content-section-top">
<div class="report-name-container">
<span class="report-name">Quarterly Review - United States -2022-1</span>
</div>
</div>
<div class= "content-section-bottom">
<div class="bottom-shape">
<div class="account-name">
<!-- <span>Niranja Industries Pension Fund - Region India</span>-->
<span>Niranja Industries Pension Fund - Country India TEST 60 CHAR THEN MOVE TO NEXT LINE</span>
</div>
<div class="report-date">September 30, 2022</div>
</div>
</div>
</div>
<div class="bp-coverpage-footer">
<span class="footer-text">Please compare this report to your custodian’s account statement.</span>
</div>
</div>
</div>
</div>
</body>
</html>
How can I manage the bottom box and the image alignment similar to the above layout? Below is the jsfiddle:
https://jsfiddle.net/niranjankala/4Lyg9hn5/14/
Please check below example snippet:
.page {
margin-bottom: 5px;
border: 1px solid #DEDEDE;
}
.landscape {
height: 8.2in;
font-size: 10px;
position: relative;
page-break-after: always;
/* page-break-inside: avoid; */
font-family: Verdana;
}
.bp-coverpage-3 {
width: 100%;
height: 100%;
}
.bp-coverpage-3 .bp-coverpage-header {
width: 100%;
height: 3.2in;
}
.bp-coverpage-3 .LogoImageSize {
max-height: 1.6in;
max-width: 3.1in;
}
.bp-coverpage-3 .bp-coverpage-header > .header-section-top {
width: 100%;
padding-top: 5%;
}
.bp-coverpage-3 .bp-coverpage-header .client-tag-line {
float: right;
margin-right: 25px;
}
.bp-coverpage-3 .bp-coverpage-header .header-section-bottom {
width: 100%;
padding-top: 10%;
}
.bp-coverpage-3 .bp-coverpage-content {
width: 100%;
border:1px solid #999;
font-family: Manrope SemiBold !important;
background: url(https://as2.ftcdn.net/v2/jpg/04/38/64/95/1000_F_438649569_DsSHTkasH6GqqQXwu7FbRG0OMHstAc2D.jpg) no-repeat bottom -120px right -170px ;
background-size: 80%;
}
.bp-coverpage-3 .content-section-top {
background:transparent;
}
.bp-coverpage-3 .content-section-bottom {
background-color:transparent;
}
.bp-coverpage-3 .bp-coverpage-content .report-name-container {
padding: 0px 0px 0px 40px;
background: #61626B;
width:35%;
position:relative;
z-index:1;
}
.bp-coverpage-3 .bp-coverpage-content .report-name-container:after {
content: '';
position: absolute;
bottom: 0;
z-index: -1;
top: 0;
left: calc(100% - 58px);
background: #61626b;
clip-path: polygon(50% 0, 100% 100%, 0 100%);
width: 135px;
height: 100%;
z-index: -1;
}
.bp-coverpage-3 .bp-coverpage-content .report-name-container:before {
content:'';
border-top: 90px solid #61626B;
border-left: 120px solid transparent;
border-right: 120px solid transparent;
position:absolute;
top:0;
right:-80px;
z-index:-1;
}
.bp-coverpage-3 .report-name-container > .report-name {
font-size: 32px;
font-weight: bold;
color:#FFFFFF;
font-family: 'Manrope SemiBold';
word-break: break-word;
width:2.8in;
height:1.5in;
display: table-cell;
vertical-align:middle;
}
.bp-coverpage-3 .bp-coverpage-content .content-section-bottom .bottom-shape {
padding: 0px 0px 0px 40px;
background: #61626B;
width:calc(40% + 25px);
position:relative;
z-index:1;
background:#E7E7E7;
}
.bp-coverpage-3 .bp-coverpage-content .content-section-bottom .bottom-shape:after {
content: '';
position: absolute;
top: 0;
left: calc(100% - 67px);
background: #e7e7e7;
clip-path: polygon(50% 0, 100% 100%, 0 100%);
width: 135px;
height: 100%;
z-index: -1;
}
.bp-coverpage-3 .bp-coverpage-content .account-name {
padding: 15px 0px 0px 0px;
font-size: 20px;
font-weight: bold;
font-family: Manrope SemiBold !important;
}
.bp-coverpage-3 .account-name > span {
width: 4.9in;
display: inline-block;
word-break: break-word;
}
.bp-coverpage-3 .bp-coverpage-content .report-date {
padding: 10px 0px 15px 0px;
font-size: 20px;
font-weight: bold;
font-family: Manrope SemiBold;
}
.bp-coverpage-3 hr {
max-width: 52px;
margin-left: 100px;
}
.bp-coverpage-3 > .bp-coverpage-footer {
color: #5B5C64;
font-family: Manrope SemiBold;
}
.bp-coverpage-3 .bp-coverpage-footer > .footer-text {
width: 93%;
display: inline-block;
padding: 20px 20px 20px 20px;
font-size: 12px;
font-weight: bold;
text-align: center;
position: absolute;
bottom: 0;
font-family: Manrope SemiBold;
}
<html lang="en" class="" style="">
<head>
<meta charset="utf-8">
<title>Print Portal</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Manrope&display=swap" rel="stylesheet">
<style>
#import url(https://fonts.googleapis.com/css2?family=Manrope&display=swap);
</style>
</head>
<body>
<div>
<div id="Report_1_Page_1" class="page landscape" style="height:8.2in !important; width:11in !important;">
<div class="bp-coverpage-3">
<div class="bp-coverpage-header">
<div class="header-section-top">
</div>
<span class="client-tag-line"> <img class="LogoImageSize" src="https://static4.depositphotos.com/1020822/359/v/950/depositphotos_3595189-stock-illustration-abstract-security-logo.jpg" alt="Logo"> </span>
<div class="header-section-bottom"></div>
</div>
<div class="bp-coverpage-content">
<div class= "content-section-top">
<div class="report-name-container">
<span class="report-name">Quarterly Review - United States -2022-1</span>
</div>
</div>
<div class= "content-section-bottom">
<div class="bottom-shape">
<div class="account-name">
<!-- <span>Niranja Industries Pension Fund - Region India</span>-->
<span>Niranja Industries Pension Fund - Country India TEST 60 CHAR THEN MOVE TO NEXT LINE</span>
</div>
<div class="report-date">September 30, 2022</div>
</div>
</div>
</div>
<div class="bp-coverpage-footer">
<span class="footer-text">Please compare this report to your custodian’s account statement.</span>
</div>
</div>
</div>
</div>
</body>
</html>
Here, I have used clip-path property.
Please let me know if you find any issues.
I am trying to display a particular div content with particular menu but my code is not showing like that. For the reference attached screenshot.(only with CSS). I don't want to use JS. When I am hovering on particular menu then all div content are displaying. And design is not looking good.
Here is my code:
<style>
.menu {
height: 24%;
width: 600px;
margin: auto;
border: 1px solid RGBA(0, 0, 0, 0.4);
font-family: calibri, monospace;
}
div.menu .button {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #333;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
div.menu .button:hover {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #ff0000;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
.menu .content {
position:absolute;
display:none;
width: 440px;
height: 23%;
margin-left: 155px;
border: 1px solid #e7e7e7;
}
.menu .content:hover {
left:150px;
top:0px;
color:black;
display:block;
}
.menu .button:hover:focus:active ~ div.content {
display: block;
}
html {
width: 100%;
height: 100%;
display: flex;
}
body {
display: flex;
margin: auto;
}
</style>
<body>
<div class="menu">
<div tabindex="0" class="button">Home</div>
<div class="content">
“A house is made of bricks and beams. A home is made of hopes and dreams. Home is where our story begins…”
</div>
<div tabindex="0" class="button">Contact</div>
<div class="content">
“Contacts added but not one is worthy enough to remain as their priority.”
</div>
<div tabindex="0" class="button">About</div>
<div class="content">
“To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.”
</div>
</div>
</body>
</html>
This is my image link.
Please try this,
.menu {
height: 24%;
width: 600px;
margin: auto;
border: 1px solid RGBA(0, 0, 0, 0.4);
font-family: calibri, monospace;
position:relative;
}
div.menu .button {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #333;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
div.menu .button:hover {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #ff0000;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
.menu .content {
position:absolute;
display:none;
width: 440px;
opacity:0;
margin-left: 155px;
border: 1px solid #e7e7e7;
}
.menu .button:hover+.content {
display: inline-block;
opacity:1;
transition:display 3s;
top:0;
}
html {
width: 100%;
height: 100%;
display: flex;
}
body {
display: flex;
margin: auto;
}
<body>
<div class="menu">
<div tabindex="0" class="button">Home</div>
<div class="content">
“A house is made of bricks and beams. A home is made of hopes and dreams. Home is where our story begins…”
</div>
<div tabindex="0" class="button">Contact</div>
<div class="content">
“Contacts added but not one is worthy enough to remain as their priority.”
</div>
<div tabindex="0" class="button">About</div>
<div class="content">
“To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.”
</div>
</div>
</body>
I'm making a titled box with css.
And my code is something like this.
I've ignored some attributes like width or height in my code.(Because I don't know why stackoverflow keeps telling me that I 've got too many codes here..)
.sponsor_info {
border-radius: 10px;
border: 1px solid #eeeeee;
width:200px;
height:50px;
padding: 0px;
}
.sponsor_info .headbar {
border-radius:10px 10px 0px 0px;
width:200px;
height: 40px;
margin-top: 0px;
background-color: #8BBE26;
}
.sponsor_info .headbar p {
font-size: 20px;
font-family: arial;
color:white;
line-height: 100%;
margin-left: 3%;
margin-top:0px;
}
<div class="sponsor_info">
<div class="headbar">
<p>Sponsor Info</p>
</div>
</div>
I can get something like below
The question now is: I don't know why there is some space between the outer grey border and the inner green bar.
.sponsor_info {
height: 200px;
border-radius: 10px;
border: 1px solid #eeeeee;
padding: 0px;
}
.sponsor_info .headbar {
height: 100px;
border-radius: 10px 10px 0px 0px;
margin-top: 0px;
background: #8BBE26;
}
.sponsor_info .headbar p {
line-height: 100px;
margin-left: 3%;
margin-top: 0px;
}
<div class="sponsor_info">
<div class="headbar">
<p>Sponsor Info</p>
</div>
</div>
change it to:
.sponsor_info .headbar p {
line-height: 100%;
margin-left: 3%;
margin-top: 0px;
}
I am struggling to create this "button" using CSS.
I also would like to be able to add the text "ABI" and "12/19" manually in my HTML so I can change it.
Attached the result I would like to have with the dimensions.
Thanks for your help.
I had fun creating it, it is not perfect and you will need some tweaking to get it exacly like the image but it should get you on the right path :
FIDDLE DEMO
html:
<div id="abi">ABI</div>
<div id="number">12/19</div>
CSS
div{
float:left;
height:60px;
line-height:60px;
font-size:20px;
margin:0;
padding:0;
}
#abi{
width:75px;
background:gray;
color:blue;
padding-left:25px;
position:relative;
z-index:2;
-webkit-border-radius: 5px 0 0 5px;
border-radius: 5px 0 0 5px;
}
#abi:after{
content:"";
position:absolute;
right:-10px;
top: 19px;
width: 0;
height: 0;
border-top: 11px solid transparent;
border-bottom: 10px solid transparent;
border-left: 10px solid gray;
}
#number{
width:155px;
text-align:right;
padding-right:25px;
background:blue;
color:gray;
-webkit-border-radius: 0 5px 5px 0;
border-radius: 0 5px 5px 0;
}
Something
LIKE THIS?
HTML
<div class='button'>ABI
<div>12/19</div>
</div>
CSS
* {
margin:0;
padding:0;
box-sizing:border-box;
}
.button, .button div {
color:grey;
background:#007bff;
display:inline-block;
line-height:60px;
font-size:20px;
}
.button div {
padding-right:25px;
padding-left:25px;
width:180px;
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
z-index:1;
text-align:left;
position:relative;
}
.button {
color:#007bff;
background:grey;
padding-left:25px;
width:280px;
text-align:right;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
position:relative;
z-index:1;
}
.button div:after {
content:'';
display:block;
position:absolute;
left:0px;
top:20px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 10px 0 10px 14px;
border-color: transparent transparent transparent grey;
z-index:0;
}
Also did one for fun.. :)
Fiddle
CSS
.btn{
position: relative;
border-radius: 10px;
display: table;
font-size: 35px;
font-family: Verdana, sans-serif;
width: 280px;
height: 60px;
background: #2a2c2b;
}
.left{
position: relative;
padding-left: 25px;
color: #0ebfe9;
display: table-cell;
width: 100px;
vertical-align: middle;
}
.right{
color: #2a2c2b;
display: table-cell;
width: 180px;
vertical-align: middle;
padding-left: 14px;
padding-right: 25px;
}
.left:after
{
height: 0px;
content: '';
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 20px solid #2a2c2b;
position: absolute;
left:90px;
}
HTML
<div class="btn"><span class="left">ABI</span><span class="right">| 12/19</span></div>
(background of btn are gradients, couldn't get them in the code here..)
Looked like fun, had to try it myself: http://jsfiddle.net/8SUX6/1/
Change href="#" to a link, to make it one or add a onclick event for it to execute JS.
ABI <span>12/19</span>
#button {
font-weight: 600;
height: 60px;
width: 60px; /* 60 + 25 + 15 = 100 */
display: block;
text-decoration: none;
background: #2A2C2B;
color: #0EBFE9;
position: absolute;
border-radius: 5px 0 0 5px;
font-family: Segoe UI;
font-size: 40px;
padding-left: 25px;
padding-right: 15px;
}
#button:before {
left: 93px;
top: 10px;
z-index: 3;
content:"";
position: absolute;
width: 0;
height: 0;
border-left: 20px solid #2A2C2B;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
}
#button span {
top: 0;
letter-spacing: 2px;
color: #2A2C2B;
position: absolute;
z-index: 2;
height: 60px;
width: 155px; /* 155 + 25 = 180px */
background: #0EBFE9;
position: absolute;
left: 100px;
border-radius: 0 5px 5px 0;
padding-right: 25px;
text-align: right;
}
The following can be the css
*{
margin:0;
padding:0;
}
div{
float:left;
margin-top:10px;
font-size:20px;
font-weight:bold;
text-align:center;
height:60px;
}
.abi{
margin-left:10px;
width:100px;
background:#2A2C2B;
color:#0EBFE9;
border-radius:10px 0 0 10px;
}
.abi>p,.num>p{
padding-top:15px;
}
.num{
color:#2A2C2B;
background:#0EBFE9;
margin-right:10px;
width:180px;
border-radius:0 10px 10px 0;
}
.abi:after{
border-bottom: 10px solid transparent;
border-left: 10px solid #2A2B2C;
border-top: 11px solid transparent;
content: "";
position: absolute;
left: 110px;
top: 29px;
}
the following is the html
<div class="abi"><p>ABI</p></div>
<div class="num"><p>12/19</p></div>
I need to make a box using css containing arc as shown in image . I want to do this using pure CSS. I am able to make arcs but not able to draw line. Here is my html and css code.
<style type="text/css">
.left_arc{
border-bottom: 1px solid #D0BFA6;
border-radius: 0 0 360px 0;
border-right: 1px solid #D0BFA6;
float: left;
height: 11px;
padding-top: 1px;
width: 11px;
}
.right_arc{
border-bottom: 1px solid #D0BFA6;
border-left: 1px solid #D0BFA6;
border-radius: 0 0 0 360px;
float: left;
height: 11px;
padding-top: 1px;
width: 11px;
}
.text_arc {
background: none repeat scroll 0 0 #FEEEEA;
border-top: 1px solid;
color: #A29061;
float: left;
font-family: times new roman;
font-size: 16px;
font-style: italic;
letter-spacing: 1px;
padding-left: 18px;
padding-top: 6px;
text-transform: uppercase;
width: 88px;
}
</style>
<div class="main_style">
<div class="left_arc"></div>
<div class="text_arc">Canada</div>
<div class="right_arc"></div>
</div>
Here is the output of my code.
LIVE DEMO
Simplify your HTML markup
and create crazy things using the CSS pseudo :before and :after selectors
HTML
<div class="main_style">
<div class="text">Canada</div>
</div>
<div class="main_style">
<div class="text">USA</div>
</div>
CSS:
.main_style {
background: none repeat scroll 0 0 #FEEEEA;
font: italic normal normal 16px/1em Times, "Times New Roman", serif;
text-transform: uppercase;
text-align:center;
letter-spacing: 1px;
color: #A29061;
position:relative;
overflow:hidden;
float: left;
}
.text{
border: 1px solid #D0BFA6;
padding:8px 20px 4px;
}
.main_style:before, .main_style:after{
content:'';
position:absolute;
top:-13px;
width:24px;
height:24px;
background:#fff;
border: 1px solid #D0BFA6;
border-radius: 42px;
}
.main_style:before{
left:-13px;
}
.main_style:after{
right:-13px;
}
You can just create a border with negative radius for only the top corners. See this post for more info...
Add extra Corner class to your left_arc and right_arc divs.
That will be shown in this JSBin.
.text_arc {
background: none repeat scroll 0 0 #FEEEEA;
border-top: 1px solid;
color: #A29061;
float: left;
font-family: times new roman;
font-size: 16px;
font-style: italic;
letter-spacing: 1px;
padding-left: 18px;
padding-top: 6px;
text-transform: uppercase;
width: 100px;
}
.corner {
position: absolute;
height: 10px;
width: 10px;
border: 1px solid #333;
background-color: #fff;
}
.left_arc {
top: -1px;
left: -1px;
border-radius: 0 0 100% 0;
border-width: 0 1px 1px 0;
}
.right_arc {
top: -1px;
left: 110px;
border-radius: 0 0 0 100%;
border-width: 0 0 1px 1px;
}
.main_style {
position: relative;
margin: 30px;
width: 119px;
height: 28px;
background: #ccc;
border: 1px solid #333;
}