A prompt box with an arrow
来源:互联网 发布:南风知我意2书包网 编辑:程序博客网 时间:2024/06/04 21:08
Today I need to use a prompt box with an arrow to prompt people.So I use css+div to make it.I will show you how to do.
Before you do it,be sure to know some knowledge about box model of css.
Padding, border and margin are optional and their default value are zero.
As you can see in the first picture,the colorful parts are border.We can set value of width and height to control border.(For convenience,I set padding zero).
If the width and height are zero,then you can see the following picture.
We can make all of four parts transparent first and second set border-bottom-color blue.Then you can get a blue triangle,put the triangle and a div together and you will get the prompt box with an arrow!
<html><head><style>.demo{ width:200px; height:200px; border:2px solid gray; position:absolute; background-color:gray; top:100px; left:100px;}.myTriangle{ position:absolute; width:0; height:0px; border:20px solid transparent; border-bottom-color:gray; top:-40px; left:20%; }</style></head><body><div class="demo"> <div class="myTriangle"></div> <label style="color:white">This is a paragraph.</label></div></body></html>
Result:
You can also change the shape of the triangle by using the following elements.
- A prompt box with an arrow
- How to cover an IE windowed control (Select Box, ActiveX Object, etc.) with a DHTML layer.
- script with a beautiful box
- An Interview with A. Stepanov
- Generate an Image with a Random Number
- setting an array element with a sequence
- 在报表画面Draw a box with title
- A configuration error occurred during startup. Please verify the preference field with the prompt:
- A Configuration error occurred during startup.Please verify the preference field with the prompt:Ca
- A configuration error occurred during startup.Please verify the preference field with the prompt: To
- A configuration error occurred during startup.Please verify the preference filed with the prompt
- a configuration error occurred during startup.Please verify the preference field with the prompt:Can
- A configuration error occurred during startup.Please verify the preference field with the prompt: To
- Arrow
- A story for anyone who with an appetite for LOVE!
- HOW TO: Create an Assembly with a Strong Name
- Algorithm: Reverse a Integer to an array with recursion
- NET: Connecting a TcpClient through an HTTP proxy with authentication
- 文章标题
- java NIO的一些个人总结
- Java垃圾回收机制(GC)详解
- 实现标准equals的流程
- libsvm3.2.1 - SVM多分类简单实现
- A prompt box with an arrow
- 二叉排序树
- 关于linux内核的数据结构——list_head
- vue各种示例展示
- Spring中的@ControllerAdvice注解的使用
- 子窗口放在父窗口上(备忘录-1)
- eclipse+keil组合配置方案教程,可替代sourceinsight+keil
- First day of my blog
- html5 表单(三) select/label/fieldset