Remove line from first and last child - css

I've got this timeline code, I am trying to remove the line on top of first child and from last child, how can I get this border, do I need to add another absolute element to cover it up or?
Image what I want removed
Same goes for the line after End button.
body {
margin: 0;
}
.tree {
position: relative;
}
.tree {
position: relative;
list-style: none;
}
li {
border-left: 1px solid #abaaed;
padding-bottom: 50px;
position: relative;
padding-left: 20px;
margin-left: 10px;
height: auto;
display: flex;
align-items: center;
}
li:last-child {
padding-bottom: 0;
}
li::before {
content: '';
width: 15px;
height: 15px;
background: white;
border: 1px solid #4e5ed3;
border-radius: 50%;
position: absolute;
left: -8px;
}
li::after {
content: '';
width: 10px;
height: 2px;
position: absolute;
left: 7px;
top: auto;
background: #4e5ed3;
}
button {
padding: 10px 20px;
}
<div>
<ul class="tree">
<li><Button>Start</Button></li>
<li>
Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.
</li>
<li><Button>
End</Button></li>
</ul>
</div>

You can try using background instead of border.
:root {
--circle-size: 15px;
}
body {
margin: 0;
}
.tree {
position: relative;
}
.tree {
position: relative;
list-style: none;
}
li {
padding-bottom: 50px;
position: relative;
padding-left: 20px;
margin-left: 10px;
height: auto;
display: flex;
align-items: center;
--line-padding: 0px;
--y-position: 0;
background: linear-gradient(#abaaed, #abaaed) 0 var(--y-position) / 1px calc(100% - var(--line-padding)) no-repeat;
}
li:first-child,
li:last-child {
--line-padding: 15px;
}
li:first-child {
--y-position: 100%;
}
li:last-child {
padding-bottom: 0;
}
li::before {
content: '';
width: 15px;
height: 15px;
background: white;
border: 1px solid #4e5ed3;
border-radius: 50%;
position: absolute;
left: -8px;
}
li::after {
content: '';
width: 10px;
height: 2px;
position: absolute;
left: 7px;
top: auto;
background: #4e5ed3;
}
button {
padding: 10px 20px;
}
<div>
<ul class="tree">
<li>
<Button>Start</Button>
</li>
<li>
Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.
</li>
<li>
<Button>
End</Button>
</li>
</ul>
</div>

Related

html css tree vertical alignment (using flex, row, flex-start)

This is a django + html, css and very minimal or no JS question of a Tree display using nested UL/LI
(so far) have found out already the work of displaying tree vertical/horizontal is done,
(current issue) aim is to display a dynamic tree or static tree using nested UL in multiple format or options for the end-users with different options (they may choose for easier visualization) like vertical tree, horizontal tree and goal on the left side or right side.
so far those are achieved
currently the issue in working on the following to display vertically aligned horizontal tree with flex, and unable to succeed with the display as the wrap of the one tree path is making some impact on the next connectors (still trying to figure out which css selector and associated property will help to clear the gap)
Please find the attached screen shot and also the code
enter image description here
Latest Results Screenshot
enter image description here
CSS code:
<style>
body {
padding-top: 10px;
}
.tree {
list-style: none;
}
.tree,
.tree * {
margin: 0;
}
.tree li {
display: flex;
flex-direction: row;
align-items: flex-start;
position: relative;
padding-left: 2vw;
}
.tree li::before {
content: '';
position: absolute;
align-items: center;
left: 0;
top: 10%;
border-top: 4px solid rgb(42, 165, 97);
width: 2vw;
}
/* ========================================================= */
.tree li::after {
content: '';
position: absolute;
align-items: flex-start;
left: 0;
top:10%;
margin-bottom: 2px;
}
.tree li:not(:only-child):after {
content: '';
position: absolute;
left: 0;
bottom: 10%;
margin-top: 0px;
margin-bottom: 2px;
border-left: 3px solid rgb(172, 206, 20);
}
/* ========================================================= */
.tree li:last-of-type::after {
height: 50%;
top: 0;
}
.tree li:first-of-type::after {
height: 50%;
bottom: 0;
}
.tree li:not(:first-of-type):not(:last-of-type)::after {
height: 100%;
}
.tree ul,
.tree ol {
padding-left: 2vw;
position: relative;
}
.tree ul:not(:empty)::before,
.tree ol:not(:empty)::before {
content: '';
position: absolute;
left: 0;
top: 8%;
border-top: 4px solid red;
width: 2vw;
}
.tree span {
border: 1px solid;
text-align: center;
padding: 0.33em 0.66em;
background-color: yellow;
color: blue;
}
.tree>li {
padding-left: 0;
}
.tree>li::before,
.tree>li::after {
display: none;
}
ol,
ul {
counter-reset: section;
}
li span::before {
counter-increment: section;
/* content: counters(section, ".") " "; */
font-family: monospace;
}
body {
/* display: flex; */
justify-content: center;
align-items: center;
height: 100%;
}
finally working to a basic draft version:
enter image description here
still has to test with different dynamic options and also create a smooth alignment between the lines.
Currently this is the working copy,
still some more - pending fixes - please find the code and screenshot
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
padding-top: 10px;
}
.tree {
list-style: none;
}
.tree,
.tree * {
margin: 0;
}
.tree li {
display: flex;
flex-direction: row;
align-items: flex-start;
position: relative;
padding-left: 2vw;
padding-bottom: 2vh;
}
.tree li::after {
content: '';
position: absolute;
left: 0;
top: 5%;
margin-top: 2px;
}
.tree li::before {
content: '';
position: absolute;
align-items: center;
left: 2px;
top: 1%;
margin-left: -2px;
margin-right: -20px;
border-top: 5px solid red;
width: 2vw;
}
.tree li:not(:last-of-type)::before {
content: '';
position: absolute;
align-items: center;
left: -2px;
margin-left: -3px;
top: 2%;
border-top: 2px solid BLUE;
width: 2vw;
}
/* ========================================================= */
.tree li:not(:only-child):not(:last-of-type)::before {
content: '';
position: absolute;
left: 0;
bottom: 0%;
margin-top: 1px;
margin-bottom: -4px;
border-left: 2px solid blue;
}
.tree li:not(:only-child):not(:first-of-type):not(:last-of-type)::before {
content: '';
position: absolute;
left: 0;
bottom: 0%;
margin-top: 1px;
margin-bottom: -4px;
border-left: 2px solid red;
}
.tree li:only-child::before {
content: '';
position: absolute;
left: 0;
bottom: 0%;
margin-top: 1px;
margin-bottom: -6px;
border-left: 0px solid grey;
}
.tree li:only-child::after {
content: '';
position: absolute;
left: 0;
bottom: 2%;
top: 14%;
margin-top: 10px;
margin-bottom: 2px;
border-left: 0px solid grey;
}
.tree li:only-last-child::after {
content: '';
position: absolute;
left: 0;
bottom: -5%;
top: -20%;
margin-top: 10px;
margin-bottom: -24px;
border-left: 10px solid yellow;
}
.tree li:only-last-child::before {
content: '';
position: absolute;
left: 0;
bottom: 0%;
top: 5%;
margin-top: -9px;
margin-bottom: 20px;
border-left: 2px solid white;
}
/* ========================================================= */
.tree li:last-of-type::after {
height: 50%;
top: 0;
}
.tree li:first-of-type::after {
height: 50%;
bottom: 0;
}
.tree li:not(:first-of-type):not(:last-of-type)::after {
height: 100%;
}
.tree ul,
.tree ol {
padding-left: 2vw;
position: relative;
}
.tree ul:not(:empty)::before,
.tree ol:not(:empty)::before {
content: '';
position: absolute;
left: 0;
top: 2%;
margin-bottom: -2px;
border-top: 2px solid blue;
width: 2vw;
}
.tree span {
border: 1px solid;
text-align: center;
padding: 0.33em 0.66em;
background-color: yellow;
color: blue;
}
.tree>li {
padding-left: 0;
}
.tree>li::before,
.tree>li::after {
display: none;
}
ol,
ul {
counter-reset: section;
}
li span::before {
counter-increment: section;
/* content: counters(section, ".") " "; */
font-family: monospace;
}
body {
/* display: flex; */
justify-content: center;
align-items: center;
height: 100%;
}
</style>
</head>
<body>
<ul class="tree">
<li><span>Main</span>
</li>
</ul>
<ul class="tree">
<li>
<span>BACKLOG</span>
<ul>
<li><span>Level1</span>
<ul>
<li><span>Level1.1</span>
<ul>
<li><span>Level1.2.1</span>
<ul>
<li><span>Level1.2.1.1</span></li>
<li><span>Level1.2.1.2</span></li>
</ul>
</li>
<li><span>Level1.2.2</span></li>
</ul>
</li>
<li><span>Level1.2</span>
<ul>
<li><span>Level1.2.1</span>
<ul>
<li><span>Level1.2.1.1</span></li>
<li><span>Level1.2.1.2</span>
<ul>
<li><span>Level1.2.1.2.1</span></li>
<li><span>Level1.2.1.2.2</span></li>
<li><span>Level1.2.1.2.3</span></li>
</ul>
</li>
<li><span>Level1.2.1.3</span></li>
</ul>
</li>
<li><span>Level1.2.2</span>
<ul>
<li><span>Level1.2.2.1</span></li>
<li><span>Level1.2.2.2</span></li>
<li><span>Level1.2.2.3</span></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>
Screenshot

Remove last child li

I would like to add line before li elements but not include after the last li. How could I do?
Here my CSS:
ul.timeline {
list-style-type: none;
position: relative
}
ul.timeline:before {
content: '';
background: #d4d9df;
display: inline-block;
position: absolute;
left: 29px;
width: 2px;
height: 100%;
z-index: 400
}
ul.timeline > li {
margin-bottom: 10px 0;
padding-left: 10px
}
ul.timeline > li:not(:last-child):after {
content: '';
background: white;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 2px solid #22c0e8;
left: 20px;
width: 20px;
height: 20px;
z-index: 400
}
JSFiddle
With your current setup, you could set height of the :before line equal to 100% - li height . Or the last li height. This is not very responsive but without knowing what you really have in your project, this is the best ( imo ) solution.
Also you have margin-bottom: 10px 0 . That is not correct. I changed it to margin-bottom: 10px;
/* Timeline Changelogs */
ul.timeline {
list-style-type: none;
position: relative
}
ul.timeline:before {
content: '';
background: #d4d9df;
display: inline-block;
position: absolute;
left: 31px;
width: 2px;
height: calc(100% - 52px);
z-index: 400
}
ul.timeline > li {
margin-bottom: 10px;
padding-left: 10px
}
ul.timeline > li:not(:last-child):after {
content: '';
background: white;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 2px solid #22c0e8;
left: 20px;
width: 20px;
height: 20px;
z-index: 400
}
<div class="col-12">
<ul class="timeline">
<li>
<p><b>20 Sept 2018</b></p>
<p>This is 20 Sept 2018</p>
</li>
<li>
<p><b>17 Sept 2018</b></p>
<p>This is 17 Sept 2018</p>
</li>
<li>
<p><b>11 Sept 2018</b></p>
<p>This is 11 Sept 2018</p>
</li>
<li>
<p><b>8 Sept 2018</b></p>
<p>This is 8 Sept 2018</p>
</li>
</ul>
</div>
OPTION 2. You could set the before line to the li elements except last-child, not to the ul. And set it a height 100% + 1em. Because in jsfiddle and snippet, p which is inside li has margin: 1em 0 by default. If you change that default margin you should consider that when setting the height.
Also, you need position:relative on li so the :before height is relative to the li not the ul. And so, you need to change the left values for the line and the circle. But it's easily adjustable.
/* Timeline Changelogs */
ul.timeline {
list-style-type: none;
position: relative
}
ul.timeline > li {
margin-bottom: 10px;
padding-left: 10px;
position:relative;
}
ul.timeline > li:not(:last-child):after {
content: '';
background: white;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 2px solid #22c0e8;
left: -21px;
width: 20px;
height: 20px;
z-index: 401
}
ul.timeline > li:not(:last-child):before {
content: '';
background: red;
display: inline-block;
position: absolute;
left: -10px;
width: 2px;
height: calc(100% + 1em);
z-index: 400;
top:0;
}
<div class="col-12">
<ul class="timeline">
<li>
<p><b>20 Sept 2018</b></p>
<p>This is 20 Sept 2018</p>
</li>
<li>
<p><b>17 Sept 2018</b></p>
<p>This is 17 Sept 2018</p>
</li>
<li>
<p><b>11 Sept 2018</b></p>
<p>This is 11 Sept 2018</p>
</li>
<li>
<p><b>8 Sept 2018</b></p>
<p>This is 8 Sept 2018</p>
</li>
</ul>
</div>
Please make these changes to your css file:
/* Timeline Changelogs */
ul.timeline {
list-style-type: none;
position: relative
}
ul.timeline > li {
margin-bottom: 10px;
padding-left: 10px;
}
ul.timeline > li:not(:last-child)::after {
content: '';
background: white;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 2px solid #22c0e8;
left: 20px;
width: 20px;
height: 20px;
z-index: 401
}
ul.timeline > li:not(:last-child)::before {
content: '';
background: red;
display: inline-block;
position: absolute;
left: 31px;
width: 2px;
height: 80px;
z-index: 400
}
There was some issue with height in your css and use ::before in li rather than in ul.
You can use this simple code:
ul {
margin-left: 10px;
padding: 0;
width: 100%;
border-left: 2px solid #999;
}
li {
list-style: none;
padding-left: 20px;
height: 100%;
margin: 0;
display: block;
position: relative;
}
li:last-child:before { /*With this you hide the last-child li line*/
content: '';
position: absolute;
left: -2px;
top: 0;
width: 2px;
height: 100%;
background-color: #fff;
}
li:after {
content: '';
position: absolute;
top: 0;
left: -12px; /*The half of the circle width minus the border width*/
border-radius: 50%;
border: 2px solid #22c0e8;
width: 20px;
height: 20px;
background: #fff;
}
<ul>
<li>
<p><b>Title</b></p>
<p>Subtitle</p>
</li>
<li>
<p><b>Title</b></p>
<p>Subtitle</p>
</li>
<li>
<p><b>Title</b></p>
<p>Subtitle</p>
</li>
<li>
<p><b>Title</b></p>
<p>Subtitle</p>
</li>
</ul>
For hide the li:last-child line I've used a before pseudoelement that goes over the line and hides it. To position the circles I used an after pseudoelement that is located right in the middle of the line. To do this we start from left: 0 minus half of the width of the circle (10) minus the width of the line (2). Both pseudoelements on the li tag.
Hope it helps you!
If you keep the current HTML structure you can do it like in the code bellow. Just moving your before element to each LI element instead of the UL, and changing the margins and paddings of the P elements inside so the left border stretches accordingly.
ul.timeline > li:before {
content: '';
background: #d4d9df;
display: inline-block;
position: absolute;
left: -9px;
width: 2px;
height: 100%;
z-index: 400
}
ul.timeline > li {
margin-bottom: 10px 0;
padding-left: 10px;
position: relative;
}
ul.timeline > li::after {
content: '';
background: white;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 2px solid #22c0e8;
left: -20px;
top: 0px;
width: 20px;
height: 20px;
z-index: 400;
}
ul.timeline > li:last-child:before{
display:none;
}
ul.timeline > li > p{
margin-top: 0px;
padding-top: 0px;
}
ul.timeline > li > p + p{
margin-bottom: 0px;
margin-top: 0em;
padding-top: 0px;
padding-bottom: 1em;
}
http://jsfiddle.net/6tcgr9eq/
Remove the : before last-child and the :after and used
ul.timeline > li:not(:last-child):after {
border-bottom: none !important;
}

Positioning left/right toggle/trigger and corresponding menu of a dropdown menu

I'm trying to position left and right variations of a dropdown menu.
My problem is with the toggle(dropdown__toggle) I try to position right, but it doesn't work; I want the toggle to be above the menu triangle;
I use a position:relative for it, if I try position:absolute it's creating a mess.
I want the toggle and menu to not have a fixed width because I need to use it in multiple situations.
.dropdown--right {
position: relative; }
.dropdown__toggle {
display:inline-block;
text-align:right;
position:relative;
right:0;
cursor: pointer; }
.dropdown__menu {
background-color: #E3E3E3;
background-clip: padding-box;
border: 1px solid #BDBDBD;
border-radius: 0.1875rem;
color: #0b0b0b;
list-style: none;
margin: 4px 0 0 0;
min-width: 10rem;
opacity: 1;
padding: 0;
right:0;
position: absolute;
pointer-events: none;
text-align: left;
top: 100%;
z-index: 99; }
.dropdown__menu__item {
display: block;
padding: 0.5rem 0.5rem;
width: 100%;
white-space: nowrap; }
.dropdown__menu:after {
border-style: solid;
bottom: 100%;
content: "";
height: 0;
position: absolute;
width: 0; }
.dropdown__menu:after {
border-style: solid;
bottom: 100%;
content: "";
height: 0;
position: absolute;
width: 0; }
.c-dropdown--right-triangle .c-dropdown__menu:before {
border-style: solid;
bottom: 100%;
content: "";
height: 0;
position: absolute;
width: 0;
right: 16px;
border-width: 0 10px 10px 10px;
border-color: #BDBDBD transparent; }
.dropdown__menu::after {
border-style: solid;
bottom: 100%;
content: "";
height: 0;
position: absolute;
width: 0;
right: 18px;
border-width: 0 8px 8px 8px;
border-color: #E3E3E3 transparent; }
<div>
<div class="dropdown--right" data-dropdown>
<a class="dropdown__toggle" >Toggle</a>
<ul class="dropdown__menu" data-dropdown-menu>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
</ul>
</div>
</div>
I added some styling and a class so you can use dropdown--left or dropdown--right to choose the display of your dropdown:
/* COMMON STYLE */
.dropdown__toggle {
display: inline-block;
position: relative;
cursor: pointer;
}
.dropdown__menu {
background-color: #E3E3E3;
background-clip: padding-box;
border: 1px solid #BDBDBD;
border-radius: 0.1875rem;
color: #0b0b0b;
list-style: none;
margin: 4px 0 0 0;
min-width: 10rem;
opacity: 1;
padding: 0 0.5rem;
position: absolute;
pointer-events: none;
top: 100%;
z-index: 99;
}
.dropdown__menu__item {
display: block;
padding: 0.5rem 0;
width: 100%;
white-space: nowrap;
}
.dropdown__menu::after {
border-style: solid;
bottom: 100%;
content: "";
height: 0;
position: absolute;
width: 0;
border-width: 0 8px 8px 8px;
border-color: #E3E3E3 transparent;
}
/* LEFT STYLE */
.dropdown--left {
position: relative;
text-align: left;
}
.dropdown--left .dropdown__menu {
left: 0;
text-align: right;
}
.dropdown--left .dropdown__menu::after {
left: 18px;
}
/* RIGHT STYLE */
.dropdown--right {
position: relative;
text-align: right;
}
.dropdown--right .dropdown__menu {
right: 0;
text-align: left;
}
.dropdown--right .dropdown__menu::after {
right: 18px;
}
<div>
<div class="dropdown--left" data-dropdown>
<a class="dropdown__toggle">Toggle</a>
<ul class="dropdown__menu" data-dropdown-menu>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
</ul>
</div>
</div>
<br><br>
<div>
<div class="dropdown--right" data-dropdown>
<a class="dropdown__toggle">Toggle</a>
<ul class="dropdown__menu" data-dropdown-menu>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
</ul>
</div>
</div>
Hope it helps.
If you want the class dropdown--right to also align the text in dropdown__toggle to the right, I think all you need is to include text-align.
.dropdown--right {
position: relative;
text-align: right; <-- Added CSS
}
Since you're going to be using this dropdown menu in multiple situations/components, I think it's as simple as adding position: absolute; and right: 0; to the .dropdown--right element, because you're going to be using it in other html elements anyway. And then for the left version of this component it'll be as easy as replacing the right: 0; with left: 0;
<div class="dropdown__containerexample">
<div class="dropdown--right" data-dropdown>
<a class="dropdown__toggle" >Toggle</a>
<ul class="dropdown__menu" data-dropdown-menu>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
<li class="dropdown__menu__item"><a>Cameras</a></li>
</ul>
</div>
</div>
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
.dropdown__containerexample {
position: relative;
width: 50%;
height: 200px;
border: 1px solid #000; }
.dropdown--right {
position: absolute;
right: 0; }
.dropdown__toggle {
cursor: pointer; }
.dropdown__menu {
background-color: #E3E3E3;
background-clip: padding-box;
border: 1px solid #BDBDBD;
border-radius: 0.1875rem;
color: #0b0b0b;
list-style: none;
margin: 4px 0 0 0;
min-width: 10rem;
opacity: 1;
padding: 0;
right:0;
position: absolute;
pointer-events: none;
text-align: left;
top: 100%;
z-index: 99; }
.dropdown__menu__item {
display: block;
padding: 0.5rem 0.5rem;
width: 100%;
white-space: nowrap; }
.dropdown__menu::after {
border-style: solid;
bottom: 100%;
content: "";
height: 0;
position: absolute;
width: 0;
right: 18px;
border-width: 0 8px 8px 8px;
border-color: #E3E3E3 transparent; }

CSS, no javaScript, a list item is losing its line-height

I've worked around a tooltip that appears in the same line where the link is located and it seems working well, best sying halfway. This tooltip is being used in a list, so it's in the same li where the link appears. The problem occurs in the next li, where the line-height seems to have been lost.
If someone could help me with this, here is the page I'm working in:
https:www.fredericopeter.com.br/playground
The damage is easily visible at the sidebar on the right side of the page.
The html code:
<ul style="margin: 2px 0 10px 20px;">
<li>Portfolio</li>
<li>Blog</li>
<li>Música</li>
<li>Video</li>
<li class="actual sidebar-tooltip">Playground<span class="txt">◄ Você está aqui</span></li>
<li style="clear: right;">Startpage [ ? ]</li>
</ul>
The css code (tooltip):
a.sidebar-tooltip:hover {
text-decoration: none;
}
a.sidebar-tooltip span {
z-index: 10;
display: none;
padding: 0;
margin-top: 0;
margin-left: 0px;
width: 100%;
text-align: right;
color: #3cbfc7;
background: transparent;
}
a.sidebar-tooltip:hover span {
display: inline;
position: absolute;
border: 0;
background: transparent;
}
.sidebar-tooltip {
width: 109px;
height: 10px;
display: inline-block;
position: relative;
border: 0;
background: transparent;
}
.sidebar-tooltip:hover .txt {
display: inline-block;
}
.sidebar-tooltip .txt {
margin-left: 3px;
color: #0a0;
width: 100%;
padding: 0;
display: none;
position: absolute;
z-index: 1000;
background: transparent;
}
.sidebar-tooltip .txt:before {
width: 0;
padding: 0;
position: absolute;
content: '';
}
You can check .sidebar-tooltip class and remove the height. I saw height is set 10px.

Floating modal window under a button

I need show a notication modal window.. But since its a fluid layout the position changes on bigger screens.
How can i position the modal window below the link like in image. I want it in the exact position. How do i go about doing it?
This should work as a base for you.
HTML
<div class="notificaton-bar">
<div class="notice">Notification
<div>
Here is the applicable note.
</div>
</div>
</div>
CSS
.notificaton-bar {
background-color: #999999;
padding: 0 10px;
}
.notice {
position: relative;
display: inline-block;
background-color: inherit;
font-size: 1.5em;
min-width: 140px;
padding: 10px 5px;
text-align: center;
}
.notice div {
display: none;
width: 130px;
padding: 10px;
font-size: .75em;
text-align: left;
background-color: inherit;
border-radius: 10px;
position: absolute;
top: 100%;
left: 50%;
margin-left: -75px;
margin-top: 10px;
}
.notice div:before {
content: '';
display: block;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 11px solid #999999;
position: absolute;
top: -10px;
left: 50%;
margin-left: -10px;
}
.notice:hover div {
display: block;
}

Resources