HTML5 之 details、dialog 和 summary

参看:

使用<details>和<summary>元素

三个不常用的HTML元素

 

details

details顾名思义,就是显示细节的,点击展开,再次点击关闭显示。

details展开时,会在标签上添加一个属性open=“open"'

当然也可以默认带有open属性的,那么就是默认展开显示

  <details>
    <p>这是一段文字1</p>
  </details>
  <details open>
    <p>这是一段文字2</p>
  </details>

Summary

Summary就是摘要,它一般和details配合使用,示例如下:

  <details>
    <summary>摘要文字</summary>
    <p>这是一段文字1</p>
  </details>
  <hr>
  <details open>
    <summary>摘要文字</summary>
    <p>这是一段文字2</p>
  </details>

 多级嵌套使用

  <details>
    <summary>摘要文字1</summary>
    <p>这是一段文字1</p>
    <details open>
      <summary>摘要文字2</summary>
      <p>这是一段文字2</p>
    </details>
  </details>

你可以发现,现在标签有默认样式,这一搬不是我们所需要的,那么你可以自定义CSS样式:

/* 设置打开时的样式 */
details[open] {
    /* 在这里添加你的样式 */
    background-color: #ddd;
}

/* 设置打开时的样式 
    Webkit内核的浏览器使用伪元素来解决这个问题:::-webkit-details-marker。通过这个伪元素,我们可以定制小三角的前景色,背景色和尺寸大小:*/
summary::-webkit-details-marker {
    color: #fff;
    background-color: #000;
}

/* 但是,直接通过::-webkit-details-marker伪元素来修改小三角的样式是行不通的。目前,我们只能通过::before和::after伪元素来替换它们。 */
summary::-webkit-details-marker {
    display: none;
}
summary:before {
    content: "\2714"; /* the new icon */
    color: #696f7c;
    margin-right: 5px;
}     

dialog

该标签只有一个open属性,用来定义对话框是否可见(默认为不可见)

<button>显示对话框</button>
<dialog>我是对话框的内容</dialog>
<script>
var oBtn = document.getElementsByTagName('button')[0];
var oDia = document.getElementsByTagName('dialog')[0]; 
oBtn.onclick = function(){
  console.log(oDia.getAttribute('open'))
  if(!oDia.getAttribute('open')){
    oDia.setAttribute('open','open');
    this.innerHTML ='隐藏文本框';
  }else{
    oDia.removeAttribute('open');
    this.innerHTML = '显示文本框';
  }
}
</script>

转载于:https://www.cnblogs.com/houfee/p/10734064.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Summary of Notable New Features in 15.7 •We added support to change installation locations. •You can Save All your pending changes before you start your update. •The update dialog provides you even more details about your update during installation. •C# 7.3 is included in Visual Studio version 15.7. •We improved solution load time for C# and VB projects. •We made numerous updates to F# and its tools, with a focus on performance. •We reduced the time to enable IntelliSense for large .NET Core projects by 25%. •We made Quick Info improvements and new .NET refactorings like convert for-to-foreach and make private fields readonly. •We added the ability to publish ASP.NET Core applications to App Service Linux without containers. •Live Unit Testing works with embedded pdbs and supports projects that use reference assemblies. •The Test Explorer has more responsive icons during test runs. •C++ developers can use CodeLens for unit testing. •We added new rules enforcing items from the C++ Core Guidelines. •Debugging large solutions with /Debug:fastlink PDBs is more robust. •CMake integration supports CMake 3.11 and static analysis. •Python projects support type hints in IntelliSense, and a Run MyPy command has been added to look for typing errors in your code. •Conda environments are supported in Python projects. •We added a next version of our Python debugger based on the popular open source pydevd debugger. •TypeScript 2.8 is included in Visual Studio version 15.7. •We improved Kestrel HTTPs support during debugging. •We added support for JavaScript debugging with Microsoft Edge. •The Debugger supports VSTS and GitHub Authentication for Source Link. •IntelliTrace's step-back debugging feature is supported for debugging .NET Core projects. •We added IntelliTrace support for taking snapshots on exceptions. •We removed the blocking modal dialog from branch checkouts in Git when a solution or project reload is not required. •You have the option to choose between OpenSSL and SChannel in Git. •You can create and associate Azure Key Vaults from within the Visual Studio IDE. •Visual Studio Tools for Xamarin can automatically install missing Android API levels required by Xamarin.Android projects. •The Xamarin.Forms XAML editor provides IntelliSense and quick fixes for conditional XAML. •Visual Studio Build Tools now supports installing into a container, and we added support for building Azure, UWP, and additional project types. •You can create build servers without installing all of Visual Studio. •The Windows 10 April 2018 Update SDK - Build 17134 is the default required SDK for the Universal Windows Platform development workload. •We added support for Visual State Management for all UWP apps and more. •We enabled automatic updates for sideloaded APPX packages. •You have new tools for migrating to NuGet PackageReference. •We added support for NuGet package signatures. •We added Service Fabric Tooling for the 6.2 Service Fabric release. •We updated Entity Framework Tools to work with the EF 6.2 runtime and to improve reverse engineering of existing databases.
Contents Acknowledgments xxxi About the Authors xxxiii Introduction 1 Who Should Read This Book 1 Key Questions Answered in This Book 2 How This Book Is Structured 2 An Overview of Changes in This Edition 3 Development Environments Used in This Book 5 Supplementary Materials Available 6 Where to Find More Information 6 Conventions Used in This Book 7 Contacting the Authors 7 I: An Overview of the Android Platform 1 Introducing Android 11 A Brief History of Mobile Software Development 11 Way Back When 11 “The Brick” 13 Wireless Application Protocol (WAP) 15 Proprietary Mobile Platforms 17 The Open Handset Alliance 18 Google Goes Wireless 18 Forming the Open Handset Alliance 19 Manufacturers: Designing Android Devices 19 Mobile Operators: Delivering the Android Experience 20 Apps Drive Device Sales: Developing Android Applications 21 Taking Advantage of All Android Has to Offer 22 The Android Marketplace: Where We Are Now 22 Android Platform Differences 23 Android: A Next-Generation Platform 23 Free and Open Source 25 Familiar and Inexpensive Development Tools 25xii Contents Reasonable Learning Curve for Developers 26 Enabling Development of Powerful Applications 26 Rich, Secure Application Integration 26 No Costly Obstacles for Development 27 A “Free Market” for Applications 27 A Growing Platform 28 The Android Platform 29 Android’s Underlying Architecture 29 Security and Permissions 31 Exploring Android Applications 32 Summary 36 Quiz Questions 36 Exercises 36 References and More Information 36 2 Setting Up Your Android Development Environment 37 Configuring Your Development Environment 37 Configuring Your Operating System for Device Debugging 39 Configuring Your Android Hardware for Debugging 39 Upgrading the Android SDK 42 Problems with the Android Software Development Kit 42 Exploring the Android SDK 43 Understanding the An
Mayavi 的参考手册,适合初学者和expert。 User guide: full table of contents An overview of Mayavi Introduction What is Mayavi2? Technical details Using Mayavi as an application, or a library? Scenes, data sources, and visualization modules: the pipeline model Loading data into Mayavi Installation Installing ready-made distributions Requirements for manual installs Doing it yourself: Python packages: Eggs Installing with easy_install Step-by-step instructions to install with eggs under Windows Under Mac OSX Snow Leopard The bleeding edge: Git Testing your installation Troubleshooting Using the Mayavi application Tutorial examples to learn Mayavi Parametric surfaces: a simple introduction to visualization Loading scalar data: the heart.vtk example Visualizing rich datasets: the fire_ug.vtu example Using Mayavi with scipy Exploring a vector field General layout of UI Visualizing data Modules Filters Interaction with the scene Mouse interaction Keyboard interaction From interactive usage to scripting The embedded Python interpreter Recording Mayavi actions to a script Command line arguments mlab: Python scripting for 3D plotting A demo 3D Plotting functions for numpy arrays 0D and 1D data 2D data 3D data Changing the looks of the visual objects created Adding color or size variations Changing the scale and position of objects Changing object properties interactively Figures, legends, camera and decorations Handling several figures Figure decorations Moving the camera Running mlab scripts Using mlab interactively Using together with Matplotlib’s pylab In scripts Animating the data Assembling pipelines with mlab Data sources Modules and filters Case studies of some visualizations Visualizing volumetric scalar data Visualizing a vector field Advanced use of Mayavi Organisation of Mayavi visualizations: the pipeline Anatomy of a Mayavi pipeline The link between different Mayavi entry points A pipeline example examined Data representation in Mayavi Introduction to TVTK datasets The flow of data Retrieving the data from Mayavi pipelines Dissection of the different TVTK datasets Inserting TVTK datasets in the Mayavi pipeline Objects populating the Mayavi pipeline Scene Source Filter ModuleManager: Colors and legends node Module Engine Base class: PipelineBase Class hierarchy Advanced Scripting with Mayavi Design Overview: Mayavi as a visualization framework Scripting the mayavi2 application Using the Mayavi envisage plugins Building applications using Mayavi Custom interactive dialogs Embedding a Mayavi scene in a Traits dialog A scene, with mlab embedded Making the visualization live Integrating in a WxPython application Integrating in a Qt application Tips and Tricks Off screen rendering Avoiding the rendering window Platform Summary Rendering using the virtual framebuffer Using VTK with Mesa for pure software rendering Extending Mayavi with customizations Customizing Mayavi2 Scripting Mayavi without using Envisage Computing in a thread Polling a file and auto-updating Mayavi Serving Mayavi on the network TCP server: the serve_tcp function UDP server: the serve_udp function Animating a visualization Animating a series of images Making movies from a stack of images Scripting from the command line Texture mapping actors Shifting data and plotting Using the UserDefined filter Sharing the same data between scenes Using mlab Using the core Mayavi API Changing the interaction with a scene Accelerating a Mayavi script Miscellaneous Citing Mayavi Getting help Tests for Mayavi Helping out Development quick start Improving the documentation Example gallery Mlab functions gallery Advanced mlab examples Interactive examples Advanced visualization examples Data interaction examples Misc examples MLab reference Plotting functions barchart contour3d contour_surf flow imshow mesh plot3d points3d quiver3d surf triangular_mesh Figure handling functions clf close draw figure gcf savefig screenshot sync_camera Figure decoration functions colorbar scalarbar vectorbar xlabel ylabel zlabel Camera handling functions move pitch roll view yaw Other functions animate axes get_engine orientation_axes outline set_engine show show_engine show_pipeline start_recording stop_recording text text3d title Mlab pipeline-control reference Sources Tools Data Modules and Filters Mayavi API reference Pipeline base objects Scene Source Filter ModuleManager Module PipelineBase Engine Main view and UI objects Scene UIs: DecoratedScene and MayaviScene SceneEditor MlabSceneModel EngineView and EngineRichView Known bugs and issues Changelog Mayavi 3.4.0 (Oct 15, 2010) Enhancements Fixes Mayavi 3.3.2 (May 25, 2010) Enhancements Fixes Mayavi 3.3.1 (Feb 24, 2010) Enhancements Fixes Mayavi 3.3.0 (July 15, 2009) Enhancements Fixes Mayavi 3.2.0 (March 23, 2009) Mayavi 3.1.0 Mayavi 3.0.3 Mayavi 3.0.1 and 3.0.2 Mayavi 3.0.0
<br/>CuteEditor功能特点 <br/>是什么使CuteEditor成为Html在线编辑器的领航者?除了其强大的功能和方便的使用, 这里还有一些顶尖的技术因素是CuteEditor编辑器成为你编辑和发布Web内容的最佳选择: <br/> 界面简洁加载速度快 <br/><br/>由于才有了很多优化方法,所以CuteEditor非常简单、小巧、装载速度快,但仍然保持功能强大、执行效率高的特点。 <br/> <br/> 跨浏览器,跨平台的所见即所得在线html编辑器 <br/><br/>兼容市面上最流行的ie5.5+,firefox1.0+,mozilla1.3+, netscape7+和Safari(1.3+)浏览器,并且包括Mac和Linux操作平台。 <br/> <br/> CuteEditor遵循Web标准,没有类似 <FONT> 这种标签 <br/><br/>你的Html编辑器还在使用类似 <FONT>这种标签么? CuteEditor会帮助你构建用户最新Web标准的html代码标签,自动生成简洁的HTML/XHTML代码。 为什么要遵循Web标准? <br/><br/>学习应用Web标准有很多益处,下面给几个简单例子:<br/><br/>获得好的搜索引擎排名: The separation of content and presentation makes the content represent a larger part of the total file size. Combined with semantic markup this will improve search engine rankings. <br/>更快的下载和加载网页: Less HTML results in smaller file sizes and quicker downloads. Modern web browsers render pages faster when they are in their standards mode than when they are in their backwards compatible mode. <br/>适应未来网页浏览器: When you use defined standards and valid code you future-proof your documents by reducing the risk of future web browsers not being able to understand the code you have used. <br/>代码编写简单,维护方便: Using more semantic and structured HTML makes it easier and quicker to understand code created by somebody else. <br/>适应其他设备: Semantic HTML, where structure is separated from presentation, makes it easier for screen readers and alternative browsing devices to interpret the content. <br/>非常好的适应性: A semantically marked up document can be easily adapted to print and alternative browsing devices, like handheld computers and cellular phones, just by linking to a different CSS file. You can also make site-wide changes to presentation by editing a single file. <br/>Read more:<br/>我的网页符合Web标准,你的呢? <br/> 能自动清理HTML代码中Word标记 <br/><br/>When text is pasted from Microsoft Word allot of unnecessary word specific markup is carried across. This can result in web pages that take an unnecessarily long time to download. The Paste from Word button solves this by removing word markup before pasting the text into your page. <br/> <br/> 支持W3C WAI和section 508的无障碍引导 <br/><br/>Cute Editor optional accessibility settings ensure your site complies with Section 508, so people with disabilities can have full access to your content.<br/> <br/> 输出的HTML或不错的XHTML供你选择 (Demo)<br/><br/>Cute Editor supports output well-formed XHTML. Your choice of XHTML 1.0 or HTML 4.01 output. <br/><br/> <br/> 无限次的撤销/恢复<br/><br/>Many of the other editors on the market cannot undo or redo certain actions, and certain table operations - such as cell merge or column deletion. Cute Editor 4.0 has a new custom undo/redo implementation to make you can now safely undo those actions. <br/><br/> <br/> 多语言支持,通过简单设置XML即可完成 (Demo)<br/><br/>All labels, buttons, tooltips and messages are located in external XML files, so that the language of the editor can be switched with a single property. You can also create a new language in a matter of minutes. <br/> <br/> 完全支持页面编辑(从 <HTML> 到 </HTML>) (Demo)<br/><br/>Cute Editor 4.0 allows you to edit a full HTML page, including <title>, <!DOCTYPE...> and some other options. You can also insert Form elements (checkbox, button, textarea, etc.) and modify certain properties of the element.<br/> <br/> 默认换行为软回车 (Demo)<br/><br/>Most other editors insert double line returns which can be annoying for clients who are used to editing in Microsoft Word. CuteEditor can be configured to use <div>, <br> or <p> tags when you press enter. In either mode <br> tags can be created by using shift+enter.<br/> <br/> 支持代码缩进和小写字母<br/><br/>Cute Editor displays nicely indented code in the HTML mode and the generating HTML tags and Attributes are in lower case. This is very convenient and important for the advanced users. <br/> <br/> 支持全屏编辑 (Demo)<br/><br/>It does not open a new window, instead it will resize to fit the browser screen. Edit in full screen mode, maximizing your available space. <br/><br/> <br/> 没有打开较慢的Java或ActiveX组件<br/><br/>100% DHTML, JavaScript ASP.Net code. There are no slow Java or ActiveX components to worry about and everything is handled in the browser! <br/><br/> <br/> 支持相对地址和URL自动关联(Demo)<br/><br/>With Cute Editor, you have the choice of using either a relative or absolute URL. <br/> <br/> 部署简单<br/><br/>The perfect addition to your content management system! Only a couple lines of code , you don't need to be an expert. Allows you to add an online HTML editing functionality that works with standard HTML form.<br/> <br/> 可以简单的通过API隐藏按钮和标签 <br/><br/>Cute Editor allows developers to set the image directory, set the controls width, disable image uploading and deleting, restrict access to the source/preview tabs, hide buttons and lists that you don't want your clients to see or access. <br/> <br/> 支持图片的文字环绕 <br/><br/>Locate the image you want to wrap text around, and click any justify button in the toolbar. The image will float to the desired direction. Text will be positioned around the image. <br/> <br/> 支持文件下载 <br/><br/>You can upload document files, create a link from your HTML content to the document files (zip files, ppt files...). <br/> <br/> CSS型皮肤 (Demo)<br/><br/>Cute Editor provides several built in themes that are ready to use. Developers can completely change the appearance of the toolbar and the dialogs by simply modifying the supplied classes and images. <br/> <br/> 高级的表格管理<br/><br/>Create and modify tables and table cells. Set their border color, alignment, cellspacing and more! Once you've created a table, simply right click inside of it and use the handy popup menu to change its attributes. <caption>,<summary>,<thead>,<tfoot>,<th> tags are supported. <br/><br/> <br/> 图片插入和自动上传<br/><br/>Built-in thumbnail generator. Thumbnail images are dynamically created; Supports upload new images. Paging - specify how many images. Support auto resize images.<br/> <br/> 具有特殊的对话框<br/><br/>With Style builder dialog box you can apply CSS style attributes directly to any HTML elements on your Web page.<br/> <br/> 支持内容模板 (Demo)<br/><br/>The basic idea behind a Content Management System (CMS) is to separate the management of content from design. Cute Editor allows the site designer to easily create and establish templates to give the site a uniform look. Templates may be modified when desired. <br/> <br/> 通过限制html和文字的长度来保护你的数据库 (Demo)<br/><br/>If you tried to insert a record whose text length is greater than allowed by your table, an error will be reported. To prevent this type of error from occurring, developers can use MaxHTMLLength or MaxTextLength in the Cute Editor to limit the length of the user抯 input. <br/> <br/> Apply security to control user access to resources <br/><br/>Cute Editor allows developers to assign a pre-defined set of permissions by group or individual. This prevents a normal user to access the administration functionality. <br/><br/>The details of permissions are specified by an XML security policy file. Each level maps to a specific file. The default mappings: <br/><br/>admin设置 admin.config <br/>default设置 default.config <br/>guest设置 guest.config <br/>You can customize and extend each policy file by editing the XML security policy file. You can also create your own policy files that define arbitrary permission sets.<br/><br/>Comparison of the sample security policy file <br/><br/> <br/>Permissions/Resource Setting Admin Default Guest <br/>AllowUpload <br/>AllowDelete <br/>AllowCopy <br/>AllowMove <br/>AllowCreateFolder <br/>AllowDeleteFolder <br/>RestrictUploadedImageDimension <br/>AutoResizeUploadedImages <br/>MaxImageWidth 6400 640 640 <br/>MaxImageHeight 4800 480 480 <br/>MaxImageSize 10000 100 100 <br/>MaxMediaSize 10000 100 100 <br/>MaxFlashSize 10000 100 100 <br/>MaxDocumentSize 10000 100 100 <br/>ImageGalleryPath ~/uploads ~/uploads/member ~/uploads/guest <br/>MediaGalleryPath ~/uploads ~/uploads/member ~/uploads/guest <br/>FlashGalleryPath ~/uploads ~/uploads/member ~/uploads/guest <br/>FilesGallaryPath ~/uploads ~/uploads/member ~/uploads/guest <br/>ImageFilters .jpg <br/>.jpeg <br/>.gif <br/>.png .jpg <br/>.jpeg <br/>.gif <br/> .jpg <br/>.jpeg <br/>.gif <br/> <br/>MediaFilters .avi <br/>.mpg <br/>.mpeg <br/>.mp3 .avi <br/>.mpg <br/>.mpeg <br/> .avi <br/>.mpg <br/>.mpeg <br/> <br/>DocumentFilters .txt, .doc<br/>.pdf, .zip<br/>.rar, .avi<br/>.mpg, .mpeg<br/>.mp3, .jpg<br/>.jpeg,.gif<br/>.png .pdf, .doc<br/> .txt, .doc<br/>.pdf, .zip<br/> <br/> <br/> 在线图片编辑<br/><br/>People that input content on a website are generally not web designers, so most don't have that design & technical fibre in them. With online image editor, you can now edit image file with no image editing software to download or install! Easy drag and drop familiar interface. Resize, change dimensions, scale, crop, add text, optimize, rotate, flip, mirror and add watermark. <br/> <br/> 控制上传文件夹大小<br/><br/>Max Upload Folder size(Including all subfolders and files. A must have feature for people who have limited hosting space.) Dynamic display of available free space in the Upload Folder.Limits the size of your upload folder. If the max is reached uploads will be disabled. <br/> <br/> 支持图片热点<br/><br/>Image maps are pictures with clickable regions also known as "hotspots." When users click on one of the hotspots, they're directed to the page you designate. CuteEditor 5.0 lets you easily create image maps to add fun and excitement to a page<br/> <br/> <div> 的盒模式<br/><br/><div> boxes offer a much greater ability to control the layout of a page. With CuteEditor, you can put any content between <div> tags and then use CSS to style all sorts of borders, backgrounds, etc. <br/> <br/> 通用虚拟键盘<br/><br/>Virtual Keyboard does not require changes to language settings of your system and even speeds up the entire text input process for your customers. It lets your native speaking clients to access your web resources from any location in the world without changing national keyboard layouts and fonts on their machines. <br/> <br/> 把图片存到数据库<br/><br/>With CuteEditor you can easily use a Sql Server database or access database as the file storage. <br/> <br/> RTF和HTML之间互相转换<br/><br/>With CuteEditor you can easily convert an HTML document into an RTF file and RTF file into HTML or XHTML document. <br/> <br/> 生成PDF文件<br/><br/>CuteEditor also allows you dynamically create Adobe PDF documents from ASP.NET.<br/> cuteEditor6.0多语言版(集成lic文件) <br/><br/>目前功能强大,最好的Asp.net编辑器之一 <br/>除了一般html编辑器具有的功能外,还有word过滤、图片在线处理、加水印等实用功能 <br/>使用关键步骤: <br/><br/>1、引用bin下的cuteEditor文件 <br/>2、在aspx页面顶部中添加引用 <br/>3、在aspx页面中加入代码 <br/>4、最后可以在.cs文件中通过来读取Editor1.Text的值来进行任意的扩展和控制了 <br/>具体配置可参照default.aspx和default.aspx.cs <br/><br/>关于cuteEditor6.0的特征及体验请浏览cuteEditor.cn,系统集成了lic授权文件,仅供体验测试使用,请不要用于任何商业用途! <br/><br/> <br/>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值