I having a small problem in getting the right character for my CSS content element. What I wanted is dots under my heading, 3 dots to be specific and so I have the following CSS:
.dotted-effect::before{
position: absolute;
top: 80%;
left: 50%;
content: '.';
font-size: 1.2em;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
transform: translateX(-50%);
pointer-events: none;
color: #444;
text-shadow: 20px 0 #444, -20px 0 #444;
-o-transition:.3s;
-ms-transition:.3s;
-moz-transition:.3s;
-webkit-transition:.3s;
transition:.3s;
}
The problem is in the way the CSS dot is displayed. Have a look at how it looks:
Notice how the dots look a bit squarish and tiny.
Now I'd like my dots to be circular and a bit bold: not ugly bold, but slightly bold.
I tried looking up Stack Overflow and a lot of people had the same problem:
This thread addresses my problem in a few ways. The problem is I am a bit specific about how I want my dots to be, and so I cannot settle for those tiny small dots. I also went through a lot of HTML ASCHII charts and none of them had what I was looking for.
What can I do next to achieve my goal?
How about background + border-radius?
http://jsfiddle.net/z7v6xk44/1/
<div class="dots"></div>
.dots, .dots:before, .dots:after {
width: 4px;
height: 4px;
background: black;
border-radius: 50%;
}
.dots{
margin: 0 auto;
position: relative;
display: inline-block;
}
.dots:before {
content: '';
position: absolute;
left: -10px;
}
.dots:after {
content: '';
position: absolute;
right: -10px;
}
Related
I am trying to add tick in my application .currently my background is black.could you please tell me how to add outline tick
heer is code
https://jsbin.com/cilocakedu/edit?html,css,output
.img {
width: 200px;
opacity: 0.5
}
.image-container {
position: relative;
text-align: center;
}
.icon {
position: absolute;
top: 50%;
left: 50%;
font-size: 5rem;
transform: translate(-50%, -50%);
}
It sounds like you are looking for a checkbox that is transparent, but with a black outline. You can try adding this to your .icon class:
color: transparent;
-webkit-text-stroke: 2px black;
Note that '-webkit-text-stroke' works on most modern browsers:
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke#Browser_compatibility
Checkboxes doesn't appear properly when using Chrome and zoom out to 75% or less. I'm also using AngularJS latest version. In FireFox and Internet Explorer they appear properly.
I tried to fix this problem with:
input[type=checkbox] {
-webkit-appearance:checkbox;
}
but this doesn't help.
Here how it looks like:
The checkboxes are custom and there is 1 span and inside 2 divs. Here is the code:
.ckeckmark {
display: inline-block;
width: 18px;
height: 18px;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}`
.ckeckmark > .stem {
position: absolute;
width: 1px;
height: 11px;
background-color: #1C4A9E;
left: 8px;
top: 2px;
}
.ckeckmark > .kick {
position: absolute;
width: 5px;
height: 1px;
background-color: #1C4A9E;
left: 3px;
top: 12px;
}
<span ng-class="{ckeckmark: resident}">
<div class="stem"></div>
<div class="kick"></div>
</span>
.stem and .kick are 2 divs next to each other inside .checkmark span class.
After research i noticed that Google Chrome displays a web page OK at 100% zoom (and above) but when the zoom level is less than 100% (e.g. 90%) padding get changed. A moves from the right-hand-side of the screen to the left hand side.
Any help/suggestions?
So I popped this into a fiddle and I think I saw your problem. It took zooming out to 33% before the checkmark disappeared at jsfiddle as opposed to your 75%.
The solution I used was to use borders on the actual stem and kick instead of using a background on those elements.
.ckeckmark {
display: inline-block;
width: 18px;
height: 18px;
border: 1px solid black;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
.stem {
position: absolute;
width: 1px;
height: 11px;
border-left: 1px solid red;
left: 8px;
top: 2px;
}
.kick {
position: absolute;
width: 5px;
height: 7px;
border-top: 1px solid red;
left: 3px;
top: 12px;
}
I have not tested this in other browsers, but I zoomed out all the way to 25% and I still saw the checkmark.
Fiddle here: http://jsfiddle.net/Lvc0u55v/1658/
Hello I was recently browsing around some demo for websites for client. And saw a really cool thing I liked. So I try to inspect in the browser to see if I replicate the effect on my own. And I have no idea how they did it.
here is the link to the demo
http://www.templatemonster.com/demo/45057.html
And here is a n image to show what I'm talking about.
They have these squares with an overflow at the bottom looking like multiple elements.
I was able to grab the HTML/CSS and replicate the just one box without the overflow. But I can't figure out how to make it look like stacked boxes, nor can I find where the code is.
I tried to replicate using JSFidle as you can see here
HTML
<div class="span2"><div class="service-box boxed green"><figure class="icon"><i class="icon-file-alt"></i></figure><div class="service-box_body"><h2 class="title">Accounting valuations</h2></div></div> </div>
.service-box.boxed {
border-radius: 0px;
box-shadow: none;
padding: 25px 15px;
margin-bottom: 30px;
text-align: center;
position: relative;
background: none repeat scroll 0% 0% #F1F6F9;
overflow: visible;
border: 1px solid #C5D0D2;
}
http://jsfiddle.net/w1defmkz/
You're pretty close but missing the :before and :after pseudo elements:
.service-box.boxed:before, .service-box.boxed:after {
content: "";
display: block;
position: absolute;
left: 1px;
right: 1px;
bottom: -4px;
height: 2px;
background: #f1f6f9;
border: 1px solid #c5d0d2;
border-top: none;
}
.service-box.boxed:before, .service-box.boxed:after {
content: "";
display: block;
position: absolute;
left: 1px;
right: 1px;
bottom: -4px;
height: 2px;
background: #f1f6f9;
border: 1px solid #c5d0d2;
border-top: none;
}
.service-box.boxed:after {
left: 3px;
right: 3px;
bottom: -7px;
}
Here's an updated fiddle: http://jsfiddle.net/w1defmkz/1/
Well, The user has added two more divisions, made them absolute.
You see, the whole span (class = "span2") is positioned relative.
This is the css for the one of them...
content: "";
display: block;
position: absolute;
left: 1px;
right: 1px;
bottom: -4px;
height: 2px;
background: #f1f6f9;
border: 1px solid #c5d0d2;
border-top: none;
Js Fiddle: http://jsfiddle.net/3my6rhgL/
Hey currently I have this css to produce a css arrow but I cannot seem to get a drop shadow on it any ideas
.arrow {
width: 0px;
height: 0px;
border-style: solid inset;
border-width: 10px 78px 0 78px;
border-color: #000 transparent transparent transparent;
z-index: 1;
}
I have dabbled with :after and :before but with no success
Since your arrow is going to be placed under a solid rectangle, this can help you
.demo {
position: absolute;
top: 50px;
left: 0px;
width: 200px;
height: 50px;
clip: rect(0px 400px 100px 0px);
}
.demo:after {
content: "";
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: black;
-webkit-transform: translate(-90px, -45px) skew(80deg) rotate(-5deg);
-moz-transform: translate(-90px, -45px) skew(80deg) rotate(-5deg);
transform: translate(-90px, -45px) skew(80deg) rotate(-5deg);
box-shadow: 30px 1px 6px blue;
}
fiddle compared with your original arrow
The problem is that the shadow can not go upwards, but usually this design wouldn't need that anyway.
Also, the base div is highly distorted, so you will need to set the shadow by trial and error.
http://css-tricks.com/triangle-with-shadow/
I think that's what you're looking for, it explains two methods to get a shadow on arrows with CSS.
One is to use a unicode triangle character and apply a shadow to that, the other is using CSS trickery with the :after selector and CSS transform.
In the following code, I want a tool-tip to come up when the user hovers the span, how do I do that? I don't want to use any links.
<span> text </span>
Here's the simple, built-in way:
<span title="My tip">text</span>
That gives you plain text tooltips. If you want rich tooltips, with formatted HTML in them, you'll need to use a library to do that. Fortunately there are loads of those.
Custom Tooltips with pure CSS - no JavaScript needed:
Example here (with code) / Full screen example
As an alternative to the default title attribute tooltips, you can make your own custom CSS tooltips using :before/:after pseudo elements and HTML5 data-* attributes.
Using the provided CSS, you can add a tooltip to an element using the data-tooltip attribute.
You can also control the position of the custom tooltip using the data-tooltip-position attribute (accepted values: top/right/bottom/left).
For instance, the following will add a tooltop positioned at the bottom of the span element.
<span data-tooltip="Custom tooltip text." data-tooltip-position="bottom">Custom bottom tooltip.</span>
How does this work?
You can display the custom tooltips with pseudo elements by retrieving the custom attribute values using the attr() function.
[data-tooltip]:before {
content: attr(data-tooltip);
}
In terms of positioning the tooltip, just use the attribute selector and change the placement based on the attribute's value.
Example here (with code) / Full screen example
Full CSS used in the example - customize this to your needs.
[data-tooltip] {
display: inline-block;
position: relative;
cursor: help;
padding: 4px;
}
/* Tooltip styling */
[data-tooltip]:before {
content: attr(data-tooltip);
display: none;
position: absolute;
background: #000;
color: #fff;
padding: 4px 8px;
font-size: 14px;
line-height: 1.4;
min-width: 100px;
text-align: center;
border-radius: 4px;
}
/* Dynamic horizontal centering */
[data-tooltip-position="top"]:before,
[data-tooltip-position="bottom"]:before {
left: 50%;
-ms-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
/* Dynamic vertical centering */
[data-tooltip-position="right"]:before,
[data-tooltip-position="left"]:before {
top: 50%;
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
[data-tooltip-position="top"]:before {
bottom: 100%;
margin-bottom: 6px;
}
[data-tooltip-position="right"]:before {
left: 100%;
margin-left: 6px;
}
[data-tooltip-position="bottom"]:before {
top: 100%;
margin-top: 6px;
}
[data-tooltip-position="left"]:before {
right: 100%;
margin-right: 6px;
}
/* Tooltip arrow styling/placement */
[data-tooltip]:after {
content: '';
display: none;
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
/* Dynamic horizontal centering for the tooltip */
[data-tooltip-position="top"]:after,
[data-tooltip-position="bottom"]:after {
left: 50%;
margin-left: -6px;
}
/* Dynamic vertical centering for the tooltip */
[data-tooltip-position="right"]:after,
[data-tooltip-position="left"]:after {
top: 50%;
margin-top: -6px;
}
[data-tooltip-position="top"]:after {
bottom: 100%;
border-width: 6px 6px 0;
border-top-color: #000;
}
[data-tooltip-position="right"]:after {
left: 100%;
border-width: 6px 6px 6px 0;
border-right-color: #000;
}
[data-tooltip-position="bottom"]:after {
top: 100%;
border-width: 0 6px 6px;
border-bottom-color: #000;
}
[data-tooltip-position="left"]:after {
right: 100%;
border-width: 6px 0 6px 6px;
border-left-color: #000;
}
/* Show the tooltip when hovering */
[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
display: block;
z-index: 50;
}
In most browsers, the title attribute will render as a tooltip, and is generally flexible as to what sorts of elements it'll work with.
<span title="This will show as a tooltip">Mouse over for a tooltip!</span>
stackoverflow.com
<img src="something.png" alt="Something" title="Something">
All of those will render tooltips in most every browser.
For the basic tooltip, you want:
<span title="This is my tooltip"> Hover on me to see tooltip! </span>
The title attribute will be used as the text for tooltip by the browser. If you want to apply style to it, consider using some libraries, e.g. jQuery UI.