How to create different shape in css?
Tags: css,css3,css-shapes
Problem :
I want to create a shape like the uploaded image wiht css. Please let me know how to do this.
Thanks
Solution :
It's not difficult. You create a circle within a wrapper that clips out what you don't need.
demo
HTML:
<div class='shape-wrap'>
<div class='shape'></div>
</div>
Relevant CSS:
.shape-wrap {
overflow: hidden;
width: 32em; height: 8em;
}
.shape {
box-sizing: border-box;
margin: -175% -50%;
width: 200%; height: 800%;
border: solid 2em dodgerblue;
border-radius: 50%;
box-shadow: inset 0 0 .5em .25em dimgrey;
}
CSS Howto..
change windowpos >= pos.top to windowpos >= (s.height()/2) + pos.top EDIT http://jsfiddle.net/BVK2q/...
You can add border on each element like this: <div style="border-bottom: 1px solid #ddd;">Journal Type:</div> Or create class in <head>: <head> <style> .border{ border-bottom: 1px solid #ddd; } </style> </head>...
These are the issues you have: The first thing I noticed is, you have opening <nav> tag at the bottom. You have to give the parent <li> (to which you...
Select all the <td> elements via getElementsByTagName() and iterate over them looking for the className: var tds = document.getElementsByTagName("td"); for (var i = 0; i<tds.length; i++) { // If it...
I post my suggestion here as an answer. Try adding an .htaccess file if you don't have one. Include the lines: RewriteEngine on RewriteBase / RewriteRule ^style\.css$ style.php [T=application/x-httpd-php,L] This...
Are your images nested in an anchor tag? E.g: <a href="#"> <img /> </a> If so this may be a default link border. Try setting this in your css: a...
Effectively, you want to prevent the inline img elements from wrapping, as such, you want to use the below on the parent #content element: white-space:nowrap; Demo Fiddle More on white-space...
I modified my XSL file as follow: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/Collection"> <table class="serviceHolder hidOverflow"> <xsl:for-each select="Content[position() mod 2=1]">...
This will work on some browsers...but not all. And it won't work on select elements in FF or IE. (I know. I tried it a week ago.) I know that...
Give a position:relative to #container and a position:absolute and left:0 to #block Then, calculate the top position of #block element with setTop() function, on document ready, on window resize and...
You can add and remove a className instead of setting style of element, use setTimeout to call requestAnimationFrame with loopKeyFrame as parameter after four seconds. function runKeyFrame() { document.getElementById("box").className =...
you need to set vertical-align to .oneAgentLegent as well. And eventually set a line-height to #agentsLegend. DEMO #agentsLegend { border: 1px solid black; border-radius:10px; display:inline-block; margin-top:5px; height:38px; line-height:30px;/* tune baseline...
Use textarea like below. It will auto scroll This will scroll automatically...<br/> <textarea type="text" class="cln" placeholder="That is my pet right there:)" col=30 rows=10> </textarea> ...
So... how to solve this problem... It was not that easy but with the help of the w3c and your answers I was able to get to a proper result....
Just going with the line below How can i target the center div of these 3 and apply css to it? Than you can use nth-of-type selector to target the...
you need to set width to .nav > ul > li to fix this issue .nav ul li:first-child, .nav ul li:last-child { width: 165px; } its working fine http://demo.sumedhasoftech.com/manoj/test/test.html...
It doesn't work because the definition in the library is more specific http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/ thanks to techfoobar...
Where are you specifying your CSS? If your code is located within your code packages, it is likely being obfuscated by the GWT compiler. This applies to <ui:style> blocks in...
Following @daniel beck comment on his answer, I got something that works: it is not perfect, header and text size have to be the same and spacing must be the...
i think this example is self explanatory: setInterval(function(){ var myElement = document.getElementById('adBottom'); if(myElement.style["visibility"]=="hidden"){ myElement.style["visibility"]="visible"; } else { myElement.style["visibility"]="hidden"; } },3000); setInteval functions like a timer which ticks in this example...
Its not a standard font. You have to make it a webfont, if so licensed....
2 ways to approach your problem: 1. Pure CSS Just increase the specifity of your selector: #Mod149 > div.moduletable-inner { box-shadow: 0px 0px 0px 0px rgba(0,0,0,.25); } 2. Using JavaScript...
Are you perhaps looking for {display:none} which makes things invisible and the space the element occupies is collapsed?...
I have obtained dissolve effect by css using keyframes and overriding the CSS of jQuery Mobile. Please add @-webkit-keyframes ,@-moz-keyframes, and @-o-keyframes in CSS like @keyframes added below. @keyframes dissolve-out...
You can filter the set of parents(), and grab the first element matching your filter: $('#my-element') .parents() .filter(function() { return $(this).css('position') == 'relative'; }).first(); Demo (Works with classes, too)...
Here's a way to do it without adding any additional markup, though you do need to add unique classes to each of the anchor links. CSS: .navbar-default .navbar-nav>.active>a:before, .navbar-nav>li>a:before {...
Use @hexblot's answer and get the color dynamically. To do this create a faux item, apply the jQuery class you want and after that use .css() to get the color....
Use the following CSS: .text-rotator span { background-color:rgba(255,0,0,0.3);/*background color and opacity together*/ } ...
You can simulate it, doing like this: CSS span{ text-shadow: 2px 2px 0px #fff, -2px -2px 0px #fff, 2px -2px 0px #fff, -2px 2px 0px #fff; } DEMO HERE...
It's pretty hard to do just with css. You probably could use some javascript to do that. But, I found a way to do what you want if your div...