I need to create this ribbon and stars look (image attached) without an image file. I know how to put the stars in it, but am needing the ribbon sides like the image is attached. How can I do this without an image file, and just pure CSS and HTML? Am thinking that the border-radius will need to be manipulated here.
This is what I have so far, which is terrible.
How can I use border-radius to get this effect?
I would recommend combining CSS triangles with pseudo elements :before and :after for the side triangles of the ribbon, and html character ★ for the stars:
working jsFiddle
HTML:
<h1>★ KRISTINE COADY ★</h1> <!-- ★ is html star character -->
CSS:
h1{ /* all regular attributes here */
background:#A52927;
display:inline-block;
padding:0px 30px;
color:#EEE4D3;
position:relative;
height:40px;
line-height:40px;
}
h1:before{ /* this will create white triangle on the left side */
position:absolute;
content:"";
top:0px;
left:0px;
height:0px;
width:0px;
border-top: 20px solid transparent;
border-left: 20px solid white;
border-bottom: 20px solid transparent;
}
h1:after{ /* this will create white triangle on the right side */
position:absolute;
content:"";
top:0px;
left:auto;
right:0px;
height:0px;
width:0px;
border-top: 20px solid transparent;
border-right: 20px solid white;
border-bottom: 20px solid transparent;
}
This way you will not have to use wrappers or border-radius.. You should ofcourse alter the font, font size, height, (etc.) to your needs..
Related
I'm working on a button, here's the demo. Right now i'm stuck at two problems i can't figure out how to solve them.
First problem: In the demo you can see an arrow down icon on the right side. When you hover over the button it's supposed to show arrow up icon, but you can see the both arrows and i only want to show one of the arrows on hover.
I haven't learned javascript yet so i'm wondering if this is possible with CSS?
Second problem: You can also see that i've added a red color on hover, but the arrows doesn't change color upon hovering. The arrows only change color if you hover your mouse on the arrows
Is there any way I can make the text and arrow change color at the same time upon hovering?
Thanks in advance.
This can be done in a much more simple fashion. There is no need for the extra spans.
http://cssdeck.com/labs/cy1u4oeu
<a class="language-icon fr" href="#" alt="choose-your-language">Language</a>
.language-icon {
color:#000;
font-weight:700;
padding-right:20px;
padding-left:30px;
display:inline-block;
font-size:11px;
text-align:right;
text-decoration:none;
position:relative;
}
.fr {
background: url(http://www.aventuredusucre.com/images/iconFrenchLanguage.gif) no-repeat;
}
.language-icon:hover {
color:#d13030;
}
.language-icon:before {
content:'';
width:0;
height:0;
position:absolute;
right:5px;
top:40%;
border-left:4px solid transparent;
border-right:4px solid transparent;
border-top:4px solid #000;
}
.language-icon:hover:before {
border-top: none;
border-bottom:4px solid #d13030;
}
1) You need to tell the down arrow to hide on hover.
.language-icon:hover .arrow-down { display: none; }
2) You're telling the arrow on hover to be black. You need to tell it to be a different colour.
.language-icon:hover .arrow-up { border-bottom: 5px solid #d13030; }
Hope that helps.
Hi I am tring to implement something like below screenshot...
Here is what i am using
border-left: 5px solid #7AC0DA;
and it gives me this output
The border is not crisp enough, as you can see in this screenshot the border does not have same width near the ends. How do I correct this ?
This is because the element has a border of 1px solid grey already, and the blue has to expand.
Your best best would be to not use border styles on the input, but something like the following:
HTML
<label class="highlight clearfix">
<span>Field name:</span>
<input />
</label>
CSS
label span, label input { float: left }
label.highlight span { border-right: 5px solid blue }
The border shows a bevel because the top and bottom have widths. You can do what you need using the pseudo-element :before
http://jsfiddle.net/sEWqW/3/
<label><input /></label>
CSS
label {
border: 1px solid #ccc;
border-left:0;
padding:.1em .3em;
position:relative;
}
label:before {
display:block;
content:".";
color:transparent;
font-size:0;
border-left:5px solid #f24495;
height:100%;
position:absolute;
left:0;
padding:1px 0;
top:-1px;
bottom:-1px;
}
label input{
border:0;
}
I'm assuming that somewhere, there is a border-width for your border-top and bottom.
I see that you set a border only on left with border-left. Maybe you should try first to set border:0 and than in the same selector, use border-left.
I am trying to make the css curve box with gradient and shadow as well as.
so how i can make with pure css and it should be only in one div not much code.
For reference see the attached image:-
you just make is border-radius as like this
Css
div {
width:200px;
margin:auto;
margin-top:20px;
height:200px;
background:red;
border-radius:25px;
box-shadow: inset 0 0 15px rgba(68,68,68,0.8);;
position:relative;
}
div:beforae {
content:"";
position:absolute;
border-left:15px solid blue;
border-right:15px solid green;
height:200px;
border-radius:15px 0 0 15px;
}
HTML
<div></div>
and now check to live demo http://jsfiddle.net/rohitazad/Vsvg2/74/
I have a table and one side of the table is an array of links. Currently I have a background color change on hover to make it appear as if the cell in the table has been pressed. The problem with this is, after setting the display:block property on the cells, when the cell is hovered over it leaves out the rounded edges and looks bad. Any way to deal with this?
CSS
.bigtable {
text-align:left;
padding:0px 5px 0px 5px;
color:white;
border: 2px solid #999999;
margin:0px 5px 0px 5px;
-moz-border-radius:20px;
-webkit-border-radius:20px;
border-radius:20px;
text-shadow:0 1px 1px white;
font-size:x-large;
}
td {
padding: 5px 5px 5px 5px;
background-color:#0063dc;
-moz-border-radius:20px;
-webkit-border-radius:10px;
border-radius:10px;
text-shadow:0 1px 1px black;
}
td a:hover {
display:block;
background-color:blue;
}
snippet of table:
<table style="width: 100%; height: 730px;" cellspacing="5" cellpadding="5" class="bigtable">
<tr>
<td>news</td>
<td><ahref="">click on this box to read about what is
mmunity</a></td>
</tr>
<tr>
i know what the problem is, but i don't know how to fix it. it's the td a:hover part of the CSS that's doing it what i'm telling it to. how can i instruct the hover of a link to change the ENTIRE td color, not just the link part?
According to the spec, this is how border-radius in CSS3 works. The content inside the box with the radius "bleeds" through the rounded corner.
You'll have to give your links a border-radius as well.
Did you try re-applying the CSS for the :hover rule? Else the inline-block may be of assistance.
What browsers display this behavior?
A quick fix for modern browsers would be to apply overflow:hidden to the container with the border-radius:
td {
padding: 5px 5px 5px 5px;
background-color:#0063dc;
-moz-border-radius:20px;
-webkit-border-radius:10px;
border-radius:10px;
text-shadow:0 1px 1px black;
overflow: hidden; /* important bit */
}
This should clip the corners of your link and maintain the cell's rounded edges.
Now, if you still wanted to affect the cell from the link, you're going to have to use javascript. CSS, by design, is devoid of parent selectors.
I'm trying to make an HTML/CSS menu in which the active link is indicated by a section of transparency (a pointer notched out of the border), to reveal the image behind the menu.
This is what I'm going for: http://larsakerson.com/northendgreenway/beta3.html
But with this sort of notched pointer: http://larsakerson.com/northendgreenway/beta2.html
Is there any way to do this in CSS (either 2.1 or 3), or is a strictly image-based menu the only way to make this work?
You can make a notched corner using borders like so...
div {
width: 0;
height: 0;
border-width: 20px;
border-style: solid;
border-color: transparent blue blue blue;
background: transparent;
}
jsFiddle.
Refer to the jsFiddle and notice the top corner is letting the background through. Simply adapt this example to your site.
here you go dude. http://jsfiddle.net/jalbertbowdenii/vnNXW/
just change .trapezoid to .active:active{}
.trapezoid {
display:block;
margin:0;
padding:0;
width:1px;
height:1px;
background:transparent;
border-style: solid;
border-color:transparent #eee #eee #eee;
border-width: 50px 50px 50px 50px;
}
and change the border-sizes to fit.
for .active{border-color:transparent}