[CSS3] CSS :target Selector
The :target selector allows us to interact with a fragment identifier, or hash, in our URL from CSS.
HTML:
<body>
<a href="#tab1">Tab 1</a><a href="#tab2">Tab 2</a><a href="#tab3">Tab 3</a>
<div id="tab1" class="tab">
<h1>Tab 1 Content</h1>
</div>
<div id="tab2" class="tab">
<h1>Tab 2 Content</h1>
</div>
<div id="tab3" class="tab">
<h1>Tab 3 Content</h1>
</div>
</body>
CSS:
<style>
.tab{
display: none;
}
.tab:target {
display: block;
}
</style>
[CSS3] CSS :target Selector的更多相关文章
- [CSS] :not Selector
The CSS :not() selector allows us to exclude a subset of elements matched by our selector. In this e ...
- CSS3 & CSS var & :root
CSS3 & CSS var & :root How to change CSS :root color variables in JavaScript https://stackov ...
- 巧用CSS3:target 伪类制作Dropdown下拉菜单(无JS)
原文链接:http://devework.com/css3-target-dropdown.html :target 是CSS3 中新增的一个伪类,用以匹配当前页面的URI中某个标志符的目标元素(比如 ...
- [CSS] Target empty elements using the :empty pseudo-class
You can target an element that has no child elements by using the :empty pseudo-class. With browser ...
- [CSS3] CSS Media Queries
Using CSS media queries allows you to design responsive layout in your web apps and website. We will ...
- [CSS3] CSS Display Property: Block, Inline-Block, and Inline
Understanding the most common CSS display types of block, inline-block, and inline will allow you to ...
- css :target
花了半小时在找如果完成:target的问题 需求:点击<a href="#Main">Main</a>时,会触发:target 效果 结果在网络上没有找到, ...
- [CSS3] CSS Background Images
Body with background image and gradient html { background: linear-gradient(#000, white) no-repeat; h ...
- [CSS] Target Positional Elements Using *-Of-Type CSS pseudo-classes
Learn how to target elements based on their position inside of a parent element in relation to its s ...
随机推荐
- shell用if
--------- shell用if出错了,Why? shell if 实例: site=github.com/fankcoder if [ $site == github.com/fankcoder ...
- Oracle数据库之PL/SQL包
Oracle数据库之PL/SQL包 1. 简介 包(PACKAGE)是一种数据对象,它是一组相关过程.函数.变量.常量和游标等PL/SQL程序设计元素的组合,作为一个完整的单元存储在数据库中,用名称来 ...
- javascript为目标标签添加class样式
利用jQuery $("#目标id").addClass("加的class名字");
- JSP执行过程
JSP执行流程: @1.客户端发出请求. @2.Web容器将JSP转译成Servlet源代码. @3.Web容器将产生的源代码进行编译. @4.Web容器加载编译后的代码并执行. @5.把执行结果响应 ...
- Javascript跳转手机站代码
$(document).ready(function(){ var mobileAgent = new Array("iphone", "ipod", &quo ...
- 那些年被我坑过的Python——道阻且长(第五章实用模块讲解)
random模块 我的随机验证吗程序: 首先保证了字母和数字出现的概率是50% VS 50%,其次是可以订制输出多少位 def Captcha(size): Captcha_list = [] for ...
- mapreduce (七) 几个实例
http://hi.baidu.com/hzd2712/item/d2465ae65270ab3e4cdcaf55 MapReduce几个典型的例子 在Google的<MapReduce: Si ...
- js/bat批处理调用谷歌浏览器chrome批量打开网页测试web性能
批处理批量打开网页 其实用java就可以搞定,但是这么一个轻巧的测试,js或者bat批处理去一次性打开几百个网页测试一下页面没必要上java 两者的区别,js的话,只能打开多个浏览器实例,不方便查看效 ...
- runAllManagedModulesForAllRequests 和 invalid url
有这样的经验, 在本地的 IIS 上网站运行正常,但是发布到服务器上就一堆怪怪的问题 : MVC routing not work http://stackoverflow.com/questions ...
- VC版本的MakeObjectInstance把WNDPROC映射到类的成员函数
这段时间用VC封装Windows类库,没有MakeObjectInstance处理窗口消息确实不爽,又不想使用MFC的消息映射,这玩意的效率和美观只能呵呵. 至于MakeObjectInstance是 ...