I'm trying to create a button with inverted half circles on the sides.
I've tried creating a half-circle and placing it at the end of the button but the outcome doesn't look pleasant.
The outcome should look something like this:
button with half circle at both end
You can just use CSS after and before Pseudo-Elements or else you can also use the CSS shadow property to achieve this kind of design. The below code shows with CSS after and before Pseudo-Elements.
https://codepen.io/Lijo_Chacko/pen/abLjEaw
HTML
<button class="circled-button">
Button
</button>
CSS
.circled-button
{
background:#000;
box-shadow:0px 0px 0px;
border:0px;
padding:20px 15px;
min-width:250px;
position:relative;
overflow:hidden;
color:#fff;
font-size:20px;
border-radius: 9px;
}
.circled-button:after
{
content:'';
display:block;
width:20px;
height:20px;
border-radius:50px;
position:absolute;
left:-9px;
background:#fff;
top:50%;
transform:translateY(-50%);
}
.circled-button:before
{
content:'';
display:block;
width:20px;
height:20px;
border-radius:50px;
position:absolute;
right:-9px;
background:#fff;
top:50%;
transform:translateY(-50%);
}
Related
Is there any way I can Name the clickable areas of an image? On mouse hover the name has to be highlighted.
http://www.fifa.com/worldcup/destination/index.html
If you visit the above mentioned link the names of the destinations gets highlighted.
How it is done in the link you provided is they set an image as the background of the div then used absolute positioning to place the click-able areas:
HTML
<div>
<span>Pepperoni!</span>
<span>Cheese!</span>
<span>Tomato!</span>
</div>
CSS
div{
background: url(http://www.lorempizza.com/200/200);
background-size:cover;
width:500px;
height:500px;
position:relative;
}
span{
display:block;
background:white;
border-radius:5px;
width:100px;
text-align:center;
padding:10px;
}
span:hover{
background:lightblue;
font-size:20pt;
}
span:nth-child(1){
position:absolute;
top:100px;
left:300px;
}
span:nth-child(2){
position:absolute;
top:300px;
left:100px;
}span:nth-child(3){
position:absolute;
top:400px;
left:300px;
}
JSFiddle Example
I am facing problem with z-index in IE7.
My actual requirement is to open the pop (kind of) div when you click on the heading.
So I am using position:absolute to pop div to place it accordingly. It works absolutely fine in all the browsers except IE7.
In IE7 you can see that second heading text is coming over pop div.
Here is my CSS
.heading{
border:solid 1px #d6d6d6;
background:#efefef;
padding:2px 6px;
margin-bottom:6px;
}
a{
color:#088f93;
text-decoration:none;
display:inline-block;
}
.pop-div{
position:relative;
}
.pop-up{
position:absolute;
top:25px;
left:0;
background:#fff;
padding:8px;
border: 1px solid #c6d0d9;
color:#404040;
display:none;
z-index:10000
}
FIDDLE
So I made a ribbon effect on my navigation no problem, but when I tried to do the same thing with the footer, I ran into issues with the right fold not appearing. This is the css I wrote for the footer ribbon.
.ribbon {
background:#8346ab;
padding:1em;
margin-left:-40px;
padding-left:40px;
padding-right:40px;
position:relative;
width:100%;
}
.ribbon:after, .ribbon:before{
content:"";
display:block;
position:absolute;
top:-10px;
border:10px solid #1f364c;
border-top-width:0;
}
.ribbon:after{
right:0;
border-right-color:transparent;
border-top-width:0;
border-left-width:0;
border-right-width:40px;
}
.ribbon:before {
left:0;
border-left-color:transparent;
border-top-width:0;
border-right-width:0;
border-left-width:40px;
}
This should have worked but not sure why the right fold isn't showing up. Any suggestions?
CSS stylesheet
div.Header
{
background-color:#999999;
text-transform:capitalize;
text-align:center;
}
div.leftdiv
{
float:left;
height:200px;
width:15%;
position:fixed;
background-color:#FFFF66;
text-transform:uppercase;
text-align:justify;
}
div.rightdiv
{ margin-left:15px;
margin-top:25px;
float:left;
position:fixed;
background-color:#FFFF99;
width:50%
height:200px;
left: 438px;
top: 39px;
}
div.footer
{
clear:both;
margin-left:20px;
margin-top:20px;
margin-right:20px;
margin-right:20px;
padding-bottom:10px;
padding-left:10px;
padding-right:10px;
padding-right:10px;
border-color:#000066
border:thick;
text-align:center;
background-color:#FFCCFF;
}
Upon further review, it looks like you have some fixed position attributes that are tripping you up. If you remove them, everything displays fine:
http://jsbin.com/emona3/3/edit
put float:left for footer its essential to move footer after all other div .
I am trying to create a little growl like div for a site. It works great in Firefox, but not IE6 (haven't tried IE7, but I still need to support IE6).
In Firefox: Centered text with image floated to right side of div
In IE6: Centered text with image to the left of text.
I've tried switching the img and span tag order, but that causes a line break in FF between the two, and IE renders the image on the right of the text, but not docked to the right side of the div.
HTML
<div id="growl">
<img src="close.gif" class="action" title="hide" />
<span class="text">Grrrrrr.......</span>
</div>
In css:
#growl {
background-color:yellow;
text-align:center;
position:absolute;
top:0; left:0;
width:98%;
padding:10px 0;
margin-left:1%;
z-index:10;
border:1px solid #CCCCCC;
}
#growl > .text {
font-size:120%;
font-weight:bold;
}
#growl > .action {
float:right;
cursor:pointer;
}
The > selector does not work on IE 6.
Just get rid of it:
#growl .text {
font-size:120%;
font-weight:bold;
}
#growl .action {
float:right;
cursor:pointer;
}
The > css selectors are not supported by IE6, try just removing them.
No point in adding a class to each elements in the div when you only have one img and span. Do this instead for cleaner code.
<div id="growl">
<img src="close.gif" title="hide" />
<span>Grrrrrr.......</span>
</div>
-
#growl {
background-color:yellow;
text-align:center;
position:absolute;
top:0; left:0;
width:98%;
padding:10px 0;
margin-left:1%;
z-index:10;
border:1px solid #CCCCCC;
}
#growl span {
font-size:120%;
font-weight:bold;
}
#growl img {
float:right;
cursor:pointer;
}