Содержание

Всплывающая подсказка на CSS

1
<link rel="stylesheet" type="text/css" href="css/style.css">

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<div>			
    <div>
        <p>Текстовая подсказка</p>
    </div>
    <p>Ты видел деву на скале</p>
    <p>В одежде белой над волнами</p>
    <p>Когда, бушуя в бурной мгле,</p>
    <p>Играло море с берегами,</p>
    <p>Когда луч молний озарял</p>
    <p>Ее всечасно блеском алым</p>
    <p>И ветер бился и летал</p>
    <p>Прекрасно море в бурной мгле</p>
    <p>И небо в блесках без лазури;</p>
    <p>Но верь мне: дева на скале</p>
    <p>Прекрасней волн, небес и бури.</p>
</div>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
 
/*-------------------------
	Css style
--------------------------*/
 
*{
    margin:0;
    padding:0;
}
 
/*-------------------------
	Общие стили
--------------------------*/
 
html{
    background-color:#eaf0f2;
}
 
body{
    font:14px/1.4 'Arial', 'Helvetica', sans-serif;
    color: #5b6469;
}
 
a, a:visited {
    outline:none;
    color:#389dc1;
}
 
a:hover{
    text-decoration:none;
}
 
section, footer, header, hgroup, aside{
    display: block;
}
 
p{
    margin-bottom:20px;
}
 
p:last-child{
    margin-bottom: 0;
}
 
/*-------------------------
	Заголовки
--------------------------*/
 
hgroup{
    text-align: center;
    padding: 60px 0 48px;
    font-family: 'PT Serif', 'Cambria', serif;
}
 
hgroup h2{
    color:#828e93;
    font-size:18px;
    font-weight: normal;
}
 
hgroup h3{
    font-size:48px;
}
 
/*-------------------------
	Цвет кнопки
--------------------------*/
 
ul{
    list-style:none;
    text-align:center;
    margin-bottom:48px;
}
 
 
ul li{
    display: inline-block;
    margin: 0 8px;
}
 
ul li:hover{
    opacity: 0.9;
}
 
ul li a{
    color:#fff !important;
    text-decoration: none !important;
    font-size:15px;
    font-weight: bold;
    display: inline-block;
    padding:6px 14px;
    border-radius:3px;
    box-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}
 
ul li:nth-child(1) a{
    background-color: #6bb9e1;
}
 
ul li:nth-child(2) a{
    background-color: #ec7164;
}
 
ul li:nth-child(3) a{
    background-color: #6ad3c3;
}
 
/*-------------------------------
	Дизайн содержимого с текстом.
-------------------------------*/
 
#content{
    background-color: #FFF;
    border-radius: 4px;
    padding: 40px;
    margin: 0 auto;
    max-width: 600px;
    position: relative;
    margin: 0 auto 100px;
}
 
/*-------------------------
	Дизайн подсказки
--------------------------*/
 
.help-tip{
    position: absolute;
    top: 15px;
    right: 300px;
    text-align: center;
    background-color: #000000;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 26px;
    cursor: default;
}
 
.help-tip:before{
    content:'?';
    font-weight: bold;
    color:#fff;
}
 
.help-tip:hover p{
    display:block;
    transform-origin: 100% 0%;
 
    -webkit-animation: fadeIn 0.3s ease-in-out;
    animation: fadeIn 0.3s ease-in-out;
 
}
 
.help-tip p{
    display: none;
    text-align: left;
    background-color: #1E2021;
    padding: 10px;
    width: 150px;
    position: absolute;
    border-radius: 3px;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    right: -4px;
    color: #FFF;
    font-size: 13px;
    line-height: 1.4;
}
 
.help-tip p:before{
    position: absolute;
    content: '';
    width:0;
    height: 0;
    border:6px solid transparent;
    border-bottom-color:#1E2021;
    right:10px;
    top:-12px;
}
 
.help-tip p:after{
    width:100%;
    height:40px;
    content:'';
    position: absolute;
    top:-40px;
    left:0;
}
 
@-webkit-keyframes fadeIn {
    0% { 
        opacity:0; 
        transform: scale(0.6);
	}
 
    100% {
        opacity:100%;
        transform: scale(1);
    }
}
 
@keyframes fadeIn {
    0% { opacity:0; }
    100% { opacity:100%; }
}

1
2
3
<div>
    <p>Текстовая подсказка</p>
</div>

1
2
3
<div>
    <p>Подсказка<b>с сылкой</b> <a href="https://sitehere.ru/">Нажми на меня!</a><i></i></p>
</div>

1
2
3
<div>
    <p>Подсказка с картинкой<br><img src="img/balloon.jpg" /></p>
</div>

<a href=»#» title=»Скачайте свежий прайс-лист»>Скачать</a>

<a href=»//impuls-web.ru/css-animaciya-poyavleniya-bez-plaginov/»>

<img src=»//impuls-web.ru/wp-content/uploads/2017/06/animate-min.jpg» alt=»CSS анимация для сайта»  title=»Перейти на статью: CSS-анимация появления без плагинов»/>

</a>

<div>

 

<a href=»//impuls-web.ru/kak-zadat-rasstoyanie-mezhdu-strok-css/»><img src=»//impuls-web.ru/wp-content/uploads/2017/07/line-height.jpg» alt=»Расстояние между строк CSS» /></a>

 

<div>Перейти на статью: Как задать расстояние между строк CSS?</div>

 

</div>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

.img-text{

position:relative;

display:block;

width:300px; /*задаём ширину блока*/

margin:auto;

}

 

.podskazka{

margin:0px!important;

opacity: 0;

position: absolute;

width: 100%;

left: 0; /*отступ слева*/

top: 105px; /*отступ сверху*/

padding:8px 0px;

font-weight:bold;

background: #444; /*задаём цвет фона*/

color: #fff!important;

text-align: center; /*выравнивание текста*/

font-size: 14px; /*размер шрифта*/

transition: all 0.6s;

}

 

.img-text:hover .podskazka{

opacity: 0.8; /*задаём уровень прозрачности*/

}








<head>

<meta name=»viewport» content=»width=device-width, initial-scale=1″>

<link rel=»stylesheet» type=»text/css» href=»css/normalize.css» />

<link rel=»stylesheet» type=»text/css» href=»css/demo.css» />

<link rel=»stylesheet» href=»fonts/font-awesome-4.2.0/css/font-awesome.min.css»>

<link rel=»stylesheet» type=»text/css» href=»css/tooltip-bloated.css» />

</head>

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

<body>

<div>

<div>

<span><a title=»На сайт» target=»_blank» href=»http://www.drogin.ru»><span>Вернуться на сайт</span></a></span>

</div>

<div>

<header>

<h2>Оформление подсказок</h2>

<nav>

<a href=»index.html»>Классик</a>

<a href=»round.html»>Круг</a>

<a href=»curved.html»>Изогнутая</a>

<a href=»sharp.html»>Острая</a>

<a href=»bloated.html»>Растянутая</a>

<a href=»box.html»>Блок</a>

<a href=»comic.html»>Забавная</a>

<a href=»line.html»>Линия</a>

<a href=»flip.html»>Разворот</a>

</nav>

</header>

<div>

<ul>

<li><a href=»#»><i></i><span>Автомобиль</span></a></li>

<li><a href=»#»><i></i><span>Велосипед</span></a></li>

<li><a href=»#»><i></i><span>Пассажирский самолет</a></li>

<li><a href=»#»><i></i><span>Автобус</span></a></li>

<li><a href=»#»><i></i><span>Истребитель</span></a></li>

</ul>

</div>

</div>

</div>

</body>


<span>Автобус</span>


Internet ExplorerChromeOperaSafariFirefoxAndroidiOS
6.0+1.0+8.0+2.0+1.0+