html 纵向选项卡,竖直选项卡式面板的实现_html/css_WEB-ITnose

前面的话:

我是html的初学者,懂得一些html的基本知识。最近开始学css,不会JavaScript。了解到adobe dw cs5的插入->spry有选项卡式面板的设计,对这个很感兴趣。但是发现默认的是tab水平排列在上面的。然而多数网站都是tab竖直排列在网页的左端。于是开始寻找修改spry插入的选项卡面板,以适应需求。

考虑到spry默认生成的选项卡式面板网页里已经包含了垂直的样式,但是大框架虽然有,直接运行则很不好看,因为只有tab竖直排列了,而内容在tab的下边而不是右侧。

实践:

新建文件,并插入spry选项卡式面板后,dw将生成三个文件:name.html(是主文件,文件名随意),SpryTabbedPanels.css,SpryTabbedPanels.js。在这里我们只修改name.html和SpryTabbedPanels.css,而js文件不动(因为我不会js,惭愧...)

在name.html中,只在选项卡面板的div前再套一层div,

...,这层div完全是配合spry本身提供的竖直排列功能的,因此class的名字最好不要改。在本文件中修改的其他部分就是网页的内容了,没有其他标签了(至多添加一个无关痛痒的

标签,如果内容段落多的话)。于是name.html的代码如下:无标题文档

Beijing

Shanghai

Tianjin

Beijing, also known as Peking, is a metropolis in northern China, and the capital of the People's Republic of China. Governed as a municipality under direct administration of the central government, Beijing borders Hebei Province to the north, west, south, and for a small section in the east, and Tianjin Municipality to the southeast. Beijing is one of the Four Great Ancient Capitals of China.

Beijing is divided into 16 urban and suburban districts and two rural counties. Beijing is a major transportation hub, with dozens of railways, roads and motorways passing through the city. It is also the destination of many international flights arriving in China. Beijing is recognized as the political, educational, and cultural center of the People's Republic of China, while Shanghai and Hong Kong predominate in economic fields. The city hosted the 2008 Olympic Games.

Few cities in the world besides Beijing have served as the political and cultural centre of an area as immense as China for so long. The Encyclopædia Britannica describes it as "one of the world's great cities," and declares that the city has been an integral part of China's history for centuries; there is scarcely a major building of any age in Beijing that doesn't have at least some national historical significance. Beijing is renowned for its opulent palaces, temples, and huge stone walls and gates. Its art treasures and universities have long made the city a centre of culture and art in China.

Shanghai is the most populous city in the People's Republic of China, which is the 10th most populous metropolitan areas in the world. A global city, Shanghai exerts influence over global commerce, finance, culture, art, fashion, research and entertainment. The city is located at the middle part of the coast of mainland China, it sits at the mouth of the Yangtze.

Originally a fishing and textiles town, Shanghai grew to importance in the 19th century due to its favorable port location and as one of the cities opened to foreign trade by the 1842 Treaty of Nanking. The city flourished as a center of commerce between east and west, and became a multinational hub of finance and business by the 1930s. After 1990, the economic reforms introduced by Deng Xiaoping resulted in intense re-development and financing in Shanghai, and in 2005 Shanghai became the world's largest cargo port.

The city is a tourist destination renowned for its historical landmarks such as the Bund and City God Temple, and its modern and ever-expanding Pudong skyline including the Oriental Pearl Tower. Today, Shanghai is the largest center of commerce and finance in mainland China, and has been described as the "showpiece" of the world's fastest-growing major economy.

Tianjin is a metropolis in Northeastern China and one of the five national central cities. It is governed as a direct-controlled municipality, one of four such designations, and is thus under direct administration of the central government, and borders Hebei Province and Beijing Municipality, bounded to the east by the Bohai Gulf portion of the Yellow Sea. In terms of urban population, it is the sixth largest city of the People's Republic of China, and its urban land area ranks 5th in the nation, only after Beijing, Shanghai, Guangzhou, and Shenzhen.

Tianjin's urban area is located along the Hai He River, which connects to the Yellow and Yangtze Rivers via the Grand Canal in Tianjin. Its ports, some distance away, are located on the Bohai Gulf in the Pacific Ocean. Tianjin was once home to foreign concessions in the late Qing Dynasty and early Kuomintang (KMT) era. The municipality incorporates the coastal region of Tanggu, home to the Binhai New Area and the Tianjin Economic-Technological Development Area (TEDA). Tianjin Municipality borders Hebei province to the north, south, and west; the Chinese capital Beijing is to the northwest, and the Bohai Gulf to the east.

SpryTabbedPanels.css的内容,因为英语不好,所以把它原本提供的英文注释都删了,此外,还把不属于.VTabbedPanels的子类的类删了,这样代码看起来清爽了很多。如下:

@charset "UTF-8";.VTabbedPanels #TabbedPanels1.TabbedPanels{margin:0px;padding:0px;border:0px;width:403px;height:auto;}.VTabbedPanels .TabbedPanelsTabGroup {/*这里设置tab组的样式*/margin: 0px;padding: 0px;border:0px;/*display:block;*/float: left;width: 100px;height: auto;/*position: relative;*/}.VTabbedPanels .TabbedPanelsTab {/*这里设置tab的样式*//*position: relative;/*display:block;*//*float: none;*/margin:5px 0px 1px 0px;top: 1px;padding: 4px 10px;font: bold;font-family:Arial;background-color: #090;color:#dfe;list-style: none;border-top: solid 3px #060;border-left: solid 3px #060;border-right: solid 3px #090;border-bottom: solid 3px #060;-moz-user-select: none;-khtml-user-select: none;cursor: pointer;}.VTabbedPanels .TabbedPanelsTabHover {/*这里设置鼠标经过*/background-color: #aeb;color:#090;}.VTabbedPanels .TabbedPanelsTabSelected {/*这里设置选中的tab的样式*/background-color: #dfe;border-right: solid 3px #dfe;color:#090;}.VTabbedPanels .TabbedPanelsContentGroup {/*这里是内容框的样式*//*clear:none;*/border-left: solid 3px #090;border-bottom: solid 3px #090;border-top: solid 3px #090;border-right: solid 3px #090;background-color: #dfe;color:#090;padding: 0px;margin:0 0 0 97px;/*97px是计算得到的,这样就能实现tab和内容连通的效果了。*/width: 300px;height: 350px;font-size:11px;font-family:Arial;}.VTabbedPanels .TabbedPanelsContentGroup p {margin:5px;padding:0px;}

js文件的代码较长,但是里面一句也没有修改。由于帖子长度有限制,就不贴在这里了。

回复讨论(解决方案)

接分的来了

不错咯~~~

向LZ学习

谢谢分享

一般是自己写代码的

有水平样式的吗。发我:lion_6@163.com

不妥啊~代码原封不懂拿过来~在浏览器上不出效果~

挺不错的,分享!

声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/563563.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

超鸿蒙混希夷的翻译,对《愚溪诗序》一处译文的思考

《愚溪诗序》文末,柳宗元写道:“以愚辞歌愚溪,则茫然而不违,昏然而同归,超鸿蒙,混希夷,寂寥而莫我知也。”人教版教参对“寂寥”的翻译是“寂寞清静”,对“莫我知”的翻译是“没有谁…

html图片自动切换的幻灯片效果的,js带点自动图片轮播幻灯片特效代码分享

本文实例讲述了javascript带点自动图片轮播幻灯片特效。分享给大家供大家参考。具体如下:这是一款基于javascript实现带点自动图片轮播幻灯片特效代码,实现过程很简单。运行效果图:-------------------查看效果下载源码-------------------小…

省份城市区县三级联动html代码,基于Jquery实现省份、城市、区县三级联动

-//W3C//DTD HTML 4.01 Transitional//EN”“;>$(document).ready(function(){//省份城市数组var fujian_city new Array(‘福州’,’漳州’,’厦门’,’龙岩’,’泉州’,’南平’,’莆田’,’宁德’,’三明’);var guangdong_city new Array(‘广州’,’深圳’,’东莞’,…

html 页面元素id不唯一,规定html元素的唯一的id属性

实例通过 JavaScript 利用 id 属性来改变一段文本:function change_header(){document.getElementById("myHeader").innerHTML"Nice day!";}Hello World!Change text亲自试一试定义和用法id 属性规定 HTML 元素的唯一的 id。id 在 HTML 文档中必…

计算机网络硬件脆弱性,计算机网络的脆弱性有哪几点

计算机网络系统在设计、实施、应用和控制过程中存在的一切可能被攻击者利用从而造成安全危害的缺陷都是网络的脆弱性。佰佰安全网的专家顾问给出了这个问题的答案。计算机网络脆弱性(vulnerability)涉及一切信息系统或信息网络中可被非预期利用的方面。从整体上看,网…

Html百分比设宽偏差大,前端开发之移动端适配详细讲解

适配问题怎么适配iphone61px问题为什么页面与设计稿会出现偏差?dpr设备像素/ css像素,只有dpr等于1的时候,实际效果和设计稿的尺寸比例才是1:1。因为iPhone6的DPR(设备像素比)为2,设备像素为750,所以iPhone6的理想视口…

关于计算机网络的描述错误的是,【单选题】以下关于计算机网络定义的描述中,错误的是...

问题:【单选题】以下关于计算机网络定义的描述中,错误的是更多相关问题我省为了解决药品价格过高的问题,决定大幅度降低药品价格,其中将原价为a元的某种常用药降价40%,则降价后的今年五月份,由于H7N9禽流感…

计算机考研学科专业基础,2018考研计算机学科专业基础综合考试大纲

I考试性质计算机学科专业基础综合考试是为高等院校和科研院所招收计算机科学与技术学科的硕士研究生而设置的具有选拔性质的联考科目,其目的是科学、公平、有效地测试考生掌握计算机科学与技术学科大学本科阶段专业知识、基本理论、基本方法的水平和分析问题、解决问…

html5 image 同步,html5 image使用大全

html5 image使用大全发布时间:2020-06-06 06:29:13来源:51CTO阅读:768作者:hello_world007html>var p_w_picpathLoader {loaded:true,loadedImages:0,totalImages:0,load:function(url){this.totalImages;this.loaded false;…

全球计算机用户人数,NIC2019年11月:全球IPv6 用户数占比中国居43位

2019年11月,全球IPv4地址分配数量为29B,其中获得最多的是肯尼亚,8B;其次是美国,3B。除亚太、欧洲、拉美、北美等地区IPv4地址已耗尽外,非洲地区处于IPv4地址耗尽第一阶段。各地区IPv4地址消耗情况&#xff…

计算机专业英语作业1,计算机专业英语作业1

计算机专业英语作业1第1-3章作业一.Vocabulary( 词汇)(一).Translate the following words and expressions into Chinese(写出下列词组的汉语。) 1.central processing unit(CPU) 2.title bar3.operating system 4&am…

登录计算机怎么保存用户名,浏览器保存了账号密码怎么查看,教您怎么查看

有时候登录一个账号输入密码时,浏览器在征得同意后会自动储存并填写密码,但是这些密码都藏哪儿去了呢?当我们忘记了的时候又该如何才能查看呢?可能一些用户不知道该怎么去查看,今天教给大家查看这些已保存的密码的方法…

html jquery 模板,用模版生成HTML的的框架jquery.tmpl使用详解

动态请求数据来更新页面是现在非常常用的方法,比如博客评论的分页动态加载,微博的滚动加载和定时请求加载等。这些情况下,动态请求返回的数据一般不是已拼好的 HTML 就是 JSON 或 XML,总之不在浏览器端拼数据就在服务器端拼数据。…

计算机网络项目化实训教程,计算机网络项目实训教程

摘要:《计算机网络项目实训教程》是专门为Nikon D700相机用户或潜在用户量身定制的实用型图书.将官方手册中抽象的功能描述及没有讲清楚的内容,通过实拍测试及精美照片示例具体地展现出来,特别是精选的摄影玩家实际使用经验与技巧,让您感觉身边时刻有"高手点拨…

计算机控制系统第1次作业,计算机控制系统第1次作业86分.doc

计算机控制系统第1次作业86分.doc?co(C)?co(C)计算机控制系统第1次作业(注意:若有主观题目,请按照题目,离线完成,完成后纸质上交学习中心,记录成绩。在线只需提交客观题答案。)本次作业是本门课程本学期的第1次作业&…

html css 魔方,css3实现立体魔方效果

css3魔方div.box {width: 300px;height: 300px;margin: 100px auto;position: relative;transform-style: preserve-3d;animation: rotate 5s linear infinite alternate;}div.box:hover{animation-play-state: paused;}keyframes rotate{0%{transform: rotateX(0) rotateY(0) …

宁波大学2020计算机技术复试线,宁波大学关于公布2020年硕士研究生复试分数线的通知...

导语:宁波大学关于公布2020年硕士研究生复试分数线的通知已发布,圣才考研网小编整理了相关信息如下,欢迎大家点击查看!更多考研动态|考试大纲|模拟试题|历年真题请关注圣才考研网。宁波大学关于公布2020年硕士研究生复试分数线的通…

计算机软件及其软件系统,计算机软件系统课件

《计算机软件系统课件》由会员分享,可在线阅读,更多相关《计算机软件系统课件(9页珍藏版)》请在人人文库网上搜索。1、计算机软件系统课件计算机软件系统课件计算机软件系统课件1一、学习者分析初一的学生,具有活泼好动的特点,怀着…

计算机语言wifi,Windows7WIFI热点设置器

/// /// 将本程序设为开启自启/// /// 自启开关/// private bool SetMeStart(bool onOff){return SelfRunning(onOff, appName, appPath);}/// /// 判断注册键值对是否存在,即是否处于开机启动状态/// /// 键值名/// private static bool IsExistKey(string keyName…

浅谈WPF之DataGrid过滤,分组,排序

使用过Excel的用户都知道,Excel可以方便的对数据进行分组,过滤,排序等操作,而在WPF中,默认提供的DataGrid只有很简单的功能,那么如何才能让我们开发的DataGrid,也像Excel一样具备丰富的客户端操…