GVKun编程网logo

CSS3效果之3D字体(css3实现文字3d效果)

10

如果您想了解CSS3效果之3D字体和css3实现文字3d效果的知识,那么本篇文章将是您的不二之选。我们将深入剖析CSS3效果之3D字体的各个方面,并为您解答css3实现文字3d效果的疑在这篇文章中,我

如果您想了解CSS3效果之3D字体css3实现文字3d效果的知识,那么本篇文章将是您的不二之选。我们将深入剖析CSS3效果之3D字体的各个方面,并为您解答css3实现文字3d效果的疑在这篇文章中,我们将为您介绍CSS3效果之3D字体的相关知识,同时也会详细的解释css3实现文字3d效果的运用方法,并给出实际的案例分析,希望能帮助到您!

本文目录一览:

CSS3效果之3D字体(css3实现文字3d效果)

CSS3效果之3D字体(css3实现文字3d效果)

总结

以上是小编为你收集整理的CSS3效果之3D字体全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

103CSS3效果:轮播图

103CSS3效果:轮播图

用CSS3实现轮播效果,轮播的触发条件是将鼠标放在轮播区上。```html:run<!DOCTYPE html><html lang="en"><head>    <Meta charset="UTF-8">    <title>Title</title>    <style>        *{            margin:0;            padding:0;        }        @keyframes aaa {            from {left:0;}            to {left:-4000px;}        }        #aaa{            margin:0 auto;            width:800px;            height:400px;            overflow: hidden;            position: relative;        }        #aaa{            background: 100% no-repeat url(https://cdn.files.qdfuns.com/article/content/picture/201804/15/111910vud6uk66ur65d6dv.png);        }        #aaa:after{            content: "";            display: block;            padding-top: 50%;        }        #bbb{            position: absolute;            width:4000px;            height:400px;        }        #bbb div{            width:800px;            height:400px;            float:left;        }        #bbb div img{            width:100%;            height:100%;        }        #bbb:hover{            animation: aaa 15s ease-in 0.5s infinite;        }    </style></head><body><div id="aaa">    <div id="bbb">        <div><img src="https://cdn.files.qdfuns.com/article/content/picture/201804/15/111910vud6uk66ur65d6dv.png" /></div>        <div><img src="https://cdn.files.qdfuns.com/article/content/picture/201804/15/111910vud6uk66ur65d6dv.png" /></div>        <div><img src="https://cdn.files.qdfuns.com/article/content/picture/201804/15/111910vud6uk66ur65d6dv.png" /></div>        <div><img src="https://cdn.files.qdfuns.com/article/content/picture/201804/15/111910vud6uk66ur65d6dv.png" /></div>        <div><img src="https://cdn.files.qdfuns.com/article/content/picture/201804/15/111910vud6uk66ur65d6dv.png" /></div>    </div></div></body></html>```

107CSS3效果:箭头代码、W轨迹

107CSS3效果:箭头代码、W轨迹

在前端编程中,经常用到箭头,有的人习惯于插入图片 ,这里提供代码的实现方法。去掉代码中所有注释内容,就显示为书名号了。还有下面那个就是就用了CSS3中动画的平移,各位看官就当闲来无事看着玩,这个效果没有什么技术含量的。```html:run<!DOCTYPE html><html lang="en"><head>  <Meta charset="UTF-8">  <title>Title</title>  <style>    *{      padding:0;      margin:0;    }    .arrow1 {      /*position: relative;*/      margin: 50px auto;      width: 100px;      height: 100px;      border: 20px solid red;      border-left: none;      border-bottom: none;      transform: rotate(45deg);    }    /*.arrow2{        transform:  translate(-60px,-9px);        position: absolute;    }*/    #div{      width:900px;      height:400px;      border:2px solid black;      margin: 100px auto;    }    #span{      float:left;      display: block;      font-size: 100px;      width: 100px;      height: 100px;      line-height: 80px;      text-align: center;      border-radius: 50%;      background: radial-gradient(blue,green);      animation: move 4s ease 0s infinite alternate;    }    @keyframes move {      0%{        transform: translate(0px,0px);      }      25%{        transform: translate(200px,300px);      }      50%{        transform: translate(400px,0px);      }      75%{        transform: translate(600px,300px);      }      100%{        transform: translate(800px,0px);      }    }  </style></head><body><!--去掉所有注释内容,显示为:右侧书名号,即“》”--><div>  <!--<div>  </div>--></div><div id="div">  <span id="span">w</span></div></body></html>```

108CSS3效果:太极图

108CSS3效果:太极图

方法一:三层div实现。思路:(1)通过渐变把外层圆形div的content分成上下黑白两个区域;(2)用中间层两个圆形div的content颜色来改变本区域的颜色;(3)用内层两个圆形div的content颜色来恢复本区域的颜色。鼠标置于太极图上,太极图还会旋转!**css 代码**```css:run<!DOCTYPE html><html><head>    <Meta charset="UTF-8">    <title>太极</title>    <style>       *{           padding:0;           margin:0;       }       .outer{           background: linear-gradient(to bottom,white 50%,black 50%);           margin:100px auto;           width:200px;           height:200px;           border-radius: 50%;           position:relative;           border:1px solid black;           transition: all 5s ease;       }       .outer:hover{           transform: rotate(360deg) scale(1.5);       }       .outer .left{           background: white;           width:100px;           height:100px;           border-radius: 50%;           position:absolute;           left: 0;           top:50px;       }       .outer .left .leftInner{           background: black;           width:40px;           height:40px;           border-radius: 50%;           position:absolute;           left: 30px;           top:30px;       }       .outer .right{           background: black;           width:100px;           height:100px;           border-radius: 50%;           position:absolute;           right: 0;           top:50px;       }       .outer .right .rightInner{           background: white;           width:40px;           height:40px;           border-radius: 50%;           position:absolute;           left:30px;           top:30px;       }    </style></head><body><div>    <div>        <div></div>    </div>    <div>        <div></div>    </div></div></body></html>```方法二:伪类实现。思路:(1)通过渐变把外层圆形div分成上下黑白两个区域;(2)添加伪类,用伪类的圆形边框颜色来改变本区域的颜色;(3)通过伪类的圆形content颜色来恢复本区域的颜色。鼠标置于太极图上,太极图还会旋转!**html 代码**```html:run<!DOCTYPE html><html><head>    <Meta charset="UTF-8">    <title>太极</title>    <style>        *{            margin:0;            padding:0;        }        div,:before,:after {            Box-sizing: border-Box;        }        #taiji {            position: absolute;            top: 50%;            left: 50%;            width: 200px;            height: 200px;            margin: -100px 0 0 -100px;            background: linear-gradient(0deg,black 50%,white 50%);            border-radius: 50%;            border:1px black solid;        }        @keyframes taiji {            from{                transform: rotate(0deg) scale(1);            }            to{                transform: rotate(360deg) scale(2);            }        }        #taiji:hover {            animation: taiji 1s ease 0s infinite;        }        #taiji:before,#taiji:after {            content: "";            display: block;            position: absolute;            width: 50%;            height: 50%;            top: 25%;            border-radius: 50%;            border: 35px solid transparent;        }        #taiji:before {            left: 0;            border-color: black;            background-color: white;        }        #taiji:after {            right: 0;            border-color: white;            background-color: black;        }    </style></head><body><div id="taiji"></div></body></html>```

80CSS3效果:bootstrap之modal

80CSS3效果:bootstrap之modal

方法一:用bootstrap.css写样式,用bootstrap.js写模态。
**html 代码**

```html:run
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<Meta charset="utf-8">
<title>Bootstrap之Modal</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.css">
</head>
<body>
<button type="button"data-toggle="modal" data-target="#myModal">点击观看弹窗效果</button>
<!--data-toggle="modal" 用于打开模态窗口。data-* 属性用于存储页面或应用程序的私有自定义数据-->
<divid="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<divrole="document">
<div>
<div>
<h4id="myModalLabel"https://www.jb51.cc/tag/dis/" target="_blank">display:inline-block">弹窗标题</h4>
<button type="button"data-dismiss="modal" aria-label="Close"https://www.jb51.cc/tag/dis/" target="_blank">display:inline-block">
<span aria-hidden="true">×</span>
</button>
</div>
<div>
<form>
<div>
<labelfor="formGroupInputLarge">用户名</label>
<div>
<inputtype="text" id="formGroupInputLarge" placeholder="用户名">
</div>
</div>
<div>
<labelfor="formGroupInputBig">密码</label>
<div>
<inputtype="password" id="formGroupInputBig" placeholder="密码">
</div>
</div>
</form>
</div>
<div>
<button type="button"data-dismiss="modal">关闭弹窗</button>
<button type="button">提交弹窗内容</button>
</div>
</div>
</div>
</div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.js"></script>
</html>
```


方法二:用bootstrap.css写样式,用modal.js写模态。
**html 代码**

```html:run
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<Meta charset="utf-8">
<title>Bootstrap之Modal</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
</head>
<body>
<button type="button"data-toggle="modal" data-target="#myModal">点击观看弹窗效果</button>
<divid="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<divrole="document">
<div>
<div>
<h4id="myModalLabel"https://www.jb51.cc/tag/dis/" target="_blank">display:inline-block">弹窗标题</h4>
<button type="button"data-dismiss="modal" aria-label="Close"https://www.jb51.cc/tag/dis/" target="_blank">display:inline-block">
<span aria-hidden="true">×</span>
</button>
</div>
<div>
<form>
<div>
<labelfor="formGroupInputLarge">用户名</label>
<div>
<inputtype="text" id="formGroupInputLarge" placeholder="用户名">
</div>
</div>
<div>
<labelfor="formGroupInputBig">密码</label>
<div>
<inputtype="password" id="formGroupInputBig" placeholder="密码">
</div>
</div>
</form>
</div>
<div>
<button type="button"data-dismiss="modal">关闭弹窗</button>
<button type="button">提交弹窗内容</button>
</div>
</div>
</div>
</div>
</body>
</html>
<!--以下是(从网上复制的----非本人所写!)modal.js代码-->
<script>
~function ($) {
''use strict'';
// MODAL CLASS DEFinitioN
var Modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$dialog = this.$element.find(''.modal-dialog'')
this.$backdrop = null
this.isShown = null
this.originalBodyPad = null
this.scrollbarWidth = 0
this.ignoreBackdropClick = false
if (this.options.remote) {
this.$element
.find(''.modal-content'')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger(''loaded.bs.modal'')
}, this))
}
}
Modal.VERSION = ''3.3.7''
Modal.TRANSITION_DURATION = 300
Modal.BACKDROP_TRANSITION_DURATION = 150
Modal.DEFAULTS = {
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle = function (_relatedTarget) {
return this.isShown ? this.hide() : this.show(_relatedTarget)
}
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event(''show.bs.modal'', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.checkScrollbar()
this.setScrollbar()
this.$body.addClass(''modal-open'')
this.escape()
this.resize()
this.$element.on(''click.dismiss.bs.modal'', ''[data-dismiss="modal"]'', $.proxy(this.hide, this))
this.$dialog.on(''mousedown.dismiss.bs.modal'', function () {
that.$element.one(''mouseup.dismiss.bs.modal'', function (e) {
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
})
})
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass(''fade'')
if (!that.$element.parent().length) {
that.$element.appendTo(that.$body) // don''t move modals dom position
}
that.$element
.show()
.scrollTop(0)
that.adjustDialog()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass(''in'')
that.enforceFocus()
var e = $.Event(''shown.bs.modal'', { relatedTarget: _relatedTarget })
transition ?
that.$dialog // wait for modal to slide in
.one(''bstransitionend'', function () {
that.$element.trigger(''focus'').trigger(e)
})
.emulatetransitionend(Modal.TRANSITION_DURATION) :
that.$element.trigger(''focus'').trigger(e)
})
}
Modal.prototype.hide = function (e) {
if (e) e.preventDefault()
e = $.Event(''hide.bs.modal'')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
this.resize()
$(document).off(''focusin.bs.modal'')
this.$element
.removeClass(''in'')
.off(''click.dismiss.bs.modal'')
.off(''mouseup.dismiss.bs.modal'')
this.$dialog.off(''mousedown.dismiss.bs.modal'')
$.support.transition && this.$element.hasClass(''fade'') ?
this.$element
.one(''bstransitionend'', $.proxy(this.hideModal, this))
.emulatetransitionend(Modal.TRANSITION_DURATION) :
this.hideModal()
}
Modal.prototype.enforceFocus = function () {
$(document)
.off(''focusin.bs.modal'') // guard against infinite focus loop
.on(''focusin.bs.modal'', $.proxy(function (e) {
if (document !== e.target &&
this.$element[0] !== e.target &&
!this.$element.has(e.target).length) {
this.$element.trigger(''focus'')
}
}, this))
}
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
this.$element.on(''keydown.dismiss.bs.modal'', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isShown) {
this.$element.off(''keydown.dismiss.bs.modal'')
}
}
Modal.prototype.resize = function () {
if (this.isShown) {
$(window).on(''resize.bs.modal'', $.proxy(this.handleUpdate, this))
} else {
$(window).off(''resize.bs.modal'')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeClass(''modal-open'')
that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger(''hidden.bs.modal'')
})
}
Modal.prototype.removeBackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass(''fade'') ? ''fade'' : ''''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $(document.createElement(''div''))
.addClass(''modal-backdrop '' + animate)
.appendTo(this.$body)
this.$element.on(''click.dismiss.bs.modal'', $.proxy(function (e) {
if (this.ignoreBackdropClick) {
this.ignoreBackdropClick = false
return
}
if (e.target !== e.currentTarget) return
this.options.backdrop == ''static''
? this.$element[0].focus()
: this.hide()
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass(''in'')
if (!callback) return
doAnimate ?
this.$backdrop
.one(''bstransitionend'', callback)
.emulatetransitionend(Modal.BACKDROP_TRANSITION_DURATION) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass(''in'')
var callbackRemove = function () {
that.removeBackdrop()
callback && callback()
}
$.support.transition && this.$element.hasClass(''fade'') ?
this.$backdrop
.one(''bstransitionend'', callbackRemove)
.emulatetransitionend(Modal.BACKDROP_TRANSITION_DURATION) :
callbackRemove()

} else if (callback) {
callback()
}
}

// these following methods are used to handle overflowing modals
Modal.prototype.handleUpdate = function () {
this.adjustDialog()
}
Modal.prototype.adjustDialog = function () {
var modalisOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight;
this.$element.css({
paddingLeft: !this.bodyIsOverflowing && modalisOverflowing ? this.scrollbarWidth : '''',
paddingRight: this.bodyIsOverflowing && !modalisOverflowing ? this.scrollbarWidth : ''''
})
}
Modal.prototype.resetAdjustments = function () {
this.$element.css({
paddingLeft: '''',
paddingRight: ''''
})
}
Modal.prototype.checkScrollbar = function () {
var fullWindowWidth = window.innerWidth
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
var documentElementRect = document.documentElement.getBoundingClientRect()
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
}
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
this.scrollbarWidth = this.measureScrollbar()
}
Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt((this.$body.css(''padding-right'') || 0), 10)
this.originalBodyPad = document.body.style.paddingRight || ''''
if (this.bodyIsOverflowing) this.$body.css(''padding-right'', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar = function () {
this.$body.css(''padding-right'', this.originalBodyPad)
}
Modal.prototype.measureScrollbar = function () { // thx walsh
var scrollDiv = document.createElement(''div'')
scrollDiv.className = ''modal-scrollbar-measure''
this.$body.append(scrollDiv)
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}

// MODAL PLUGIN DEFinitioN
function Plugin(option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data(''bs.modal'')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == ''object'' && option);
if (!data) $this.data(''bs.modal'', (data = new Modal(this, options)))
if (typeof option == ''string'') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
var old = $.fn.modal;
$.fn.modal = Plugin;
$.fn.modal.Constructor = Modal;

// MODAL NO CONFLICT
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}

// MODAL DATA-API
$(document).on(''click.bs.modal.data-api'', ''[data-toggle="modal"]'', function (e) {
var $this = $(this)
var href = $this.attr(''href'')
var $target = $($this.attr(''data-target'') || (href && href.replace(/.*(?=#[^\s]+$)/, ''''))) // strip for ie7
var option = $target.data(''bs.modal'') ? ''toggle'' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is(''a'')) e.preventDefault()
$target.one(''show.bs.modal'', function (showEvent) {
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
$target.one(''hidden.bs.modal'', function () {
$this.is('':visible'') && $this.trigger(''focus'')
})
})
Plugin.call($target, option, this)
})
}(jQuery);
</script>
</body>
</html>
```

总结

以上是小编为你收集整理的80CSS3效果:bootstrap之modal全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

原文地址:https://www.cnblogs.com/gushixianqiancheng/p/10967089.html

今天关于CSS3效果之3D字体css3实现文字3d效果的讲解已经结束,谢谢您的阅读,如果想了解更多关于103CSS3效果:轮播图、107CSS3效果:箭头代码、W轨迹、108CSS3效果:太极图、80CSS3效果:bootstrap之modal的相关知识,请在本站搜索。

本文标签: