html+CSS3网页中用到的提示样式

2026-04-30 11:18:15

1、准备好需要用到的图标。

html+CSS3网页中用到的提示样式

2、新建html文档。

html+CSS3网页中用到的提示样式

3、书写hmtl代码。

<div id="wrapper">

 <h2>Simple</h2>

 <div class="noticeui noticeui-success">

  1111111111111111

  <span></span> </div>

 <div class="noticeui noticeui-warn">

  22222

  <span></span> </div>

 <div class="noticeui noticeui-error">

  33333

  <span></span> </div>

 <div class="noticeui noticeui-info">

  44444444 <span></span> 

 </div>

</div>

html+CSS3网页中用到的提示样式

4、书写css代码。

.noticeui { background: url(../images/noticeui/notice-bg.png) repeat-x 0 0; color: #FFF; width: 83%; font-weight: normal; padding: 13px 15px 0; margin-bottom: 2.5em; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; -moz-box-shadow: 1px 1px 2px rgba(0,0,0,.4); -webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.4); box-shadow: 1px 1px 2px rgba(0,0,0,.4); position: relative; left: 34px; }

.noticeui p { margin-bottom: 1.5em; }

.noticeui p:last-child { margin-bottom: 0; }

.noticeui ul { margin-left: 8px; margin-bottom: 1.5em; }

.noticeui ul:last-child { margin-bottom: 0; }

.noticeui li { background: url(../images/noticeui/notice-tabs.png) no-repeat 0 -95px; list-style-type: none; padding-left: 18px; margin-bottom: .75em; }

.noticeui-success li { background-position: 0 -95px; }

.noticeui-warn li { background-position: 0 -895px; }

.noticeui-error li { background-position: 0 -495px; }

.noticeui-info li { background-position: 0 -1295px; }

.noticeui h5 { font-size: 14px; font-weight: bold; margin-bottom: .65em; }

.noticeui span { background: url(../images/noticeui/notice-tabs.png) no-repeat 100% 0; width: 33px; height: 40px; position: absolute; left: -34px; top: 9px; }

.noticeui-success { background-color: #EEF4D4; color: #596C26; border: 1px solid #8FAD3D; }

.noticeui-success span { background-position: 100% 0; }

.noticeui-warn { background-color: #FFEA97; color: #796100; border: 1px solid #E1B500; }

.noticeui-warn span { background-position: 100% -800px; }

.noticeui-error { background-color: #EFCEC9; color: #933628; border: 1px solid #AE3F2F; }

.noticeui-error span { background-position: 100% -400px; }

.noticeui-info { background-color: #C6D8F0; color: #285797; border: 1px solid #4381CD; }

.noticeui-info span { background-position: 100% -1200px; }

body { font: 12px/1.7em arial, sans-serif; margin: 75px; }

#wrapper { width: 500px; margin: 0 auto; }

h2 { font-size: 20px; border-bottom: 1px dotted #CCC; padding-bottom: .25em; margin-bottom: 1.5em; }

html+CSS3网页中用到的提示样式

5、代码整体结构。

html+CSS3网页中用到的提示样式

6、查看效果。

html+CSS3网页中用到的提示样式

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢