- 浏览: 398643 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (171)
- 学习网站 (3)
- 生活点滴 (10)
- javascript (35)
- java (8)
- select/option (4)
- SQL (4)
- database存取 (5)
- intra-mart (1)
- java面试相关 (8)
- hibernate (2)
- IDE related (6)
- Websphere (6)
- software development (1)
- ibatis (4)
- JSF (5)
- dojo (6)
- java web (2)
- xml (0)
- DB2 (11)
- version control (4)
- xml,excel,json related (3)
- 工具收集 (1)
- BW (13)
- abap (1)
最新评论
-
Trying:
mysql会怎样呢?编程时,到底要不要排序呢?听说排序会对性能 ...
sql中没有order by,是否存在默认排序 -
yanwushu:
CASE WHEN 有两种表达式写法: ...
oracle case when的用法 -
Matol:
ok,不错的
java去除字符串中的空格、回车、换行符、制表符 -
jianxia801:
现在天下文章一大抄;实际没有这个fromString方法:准确 ...
JSON与JAVA的数据转换--String->Bean -
春隆隆:
精辟
java去除字符串中的空格、回车、换行符、制表符
定义和用法
title 属性可设置或返回对元素的描述性短语。
语法
bodyObject.title=title
example1:
<body id="myid" title="mytitle">
<script type="text/javascript">
x=document.getElementsByTagName('body')[0];
document.write("Body title: " + x.title);
document.write("<br />");
document.write("An alternate way: ");
document.write(document.getElementById('myid').title);
</script>
</body>
example2:
<a href="http://www.baidu.com/" title="begin XHTML study">XHTML学习</a>
说明
可以为链接,表单等元素提供额外的信息(HTML中所有元素都具有title属性),比如可以通过title属性详细介绍要链接到的页面的内容.
鼠标停留在链接或表单上面时,显示提示文字.
一些可以发音的浏览器,可以说出"title"里的内容
example3:
带换行的title测试
<div title="123 456">text</div>
<div title="123& #10;456">text</div>
<a href="" title="怎样强 制换行">留言</a>
<div title="I am a happy girl, I am very happy. I want to be happy forever.That's the words I want to say to everybody, I hope everyone will be happy every day.">long text</div>
ToolTip Torture Test
Tooltips can be very useful things, but there are a few intracies that most authors don’t understand how to take advantage of, and a few behaviors that are bugs in the various browser implementations.
Several attributes should cause a tooltip or similar display when the cursor is passed over an object with some or all of them. title should always display its contents, while alt should only be displayed when the image has not been loaded. I am not sure how longdesc should be handled; it is paired with alt in the HTML 4.01 specification, and seems designed to provide a textual description of the image in lieu of actually showing the image (primarially for blind people, perhaps), but the spec is silent on this, and it could be used simply as a means for providing an extended description or information about the image appropriate for all users. Therefore, it is my contention that this link should always be displayed.
TITLE & ALT
Move your mouse cursor over the checkmark, and you should see a tooltip with the phrase, “This is a checkmark.” displayed near the cursor. If it displays “checkmark image” instead, your browser is displaying the title attribute instead.
TITLE, ALT, & LONGDESC
This image should display a tooltip identical to the one above, but it should also have some sort of a hyperlink displayed near or attached to it. A URL is specified in the LONGDESC attribute of that image tag.
Really Long Text
This image has an extremely long text string specified as the ALT text. The string ends with “…will be gray.” and you should see that.
Ignoring Line Breaks
This image’s ALT text is four sentences, with a line break between each sentence. According to the HTML specification, these line breaks should be ignored, but Internet Explorer 6.0 interprets them; putting each sentence on a new line of the tooltip. This is both useful and problematic behavior—and very incorrect. The HTML specification should be modified to allow for simple formatting such as line breaks, bolding, and itallics.
Forcing Line Breaks
The HTML specification specifies that all linefeeds shall be ignored, but some method of indicating them in tooltips is needed. Two methods that occur to me are using 
 (Unicode NewLine) or /A (CSS2 escape sequence for a traditional newline).
Typesetting Character Entities
This tooltip should contain several typesetting characters, including an em dash after checkmark, a built fraction for 1/4 and double prime for 1/4 inch, curly quotes around feature chart, and an ellipsis at the end.
UTF-8 Typesetting Characters
This tooltip should contain several typesetting characters, including an em dash after checkmark, a built fraction for 1/4 and double prime for 1/4 inch, curly quotes around feature chart, and an ellipsis at the end.
大概的意思是,XHTML DTD定义title属性为一个CDATA,而根据SGML里CDATA的定义,浏览器应该:替换所有html实体;忽略LF字符;替换所有CR字符和tab字符为一个空格。
按照W3C的说法,执行这3步后,所有的CR和LF字符已经他们的html实体都已消失或变成空格了。看起来在title里换行变成不可能的事了。不过,Firefox好像并没有转换CR字符为空格,而是把CR给忽略了。而LF字符倒是没有被处理,直接换行了。上面的代码,不用UNIX行尾符LF,而是用Mac行尾符CR,在IE下还能换行,但是在Firefox下,CR字符直接被忽略了。我还是很想通过W3C的验证,所以做了一下测试,使用LF字符或者LF的html实体& #10;都是可以的。网上流传说可以用CR的html实体& #13;,其实只是IE中可以,Firefox下一样不行。如果不追求符合W3C,那还不如直接把字符串转成UNIX行尾符输出呢
还有,title里有小于号和单引号好像并不要紧,但是有双引号就不行了。这么说来,把字符串里的换行和双引号给替换一下输出就行了?go on learning...
title 属性可设置或返回对元素的描述性短语。
语法
bodyObject.title=title
example1:
<body id="myid" title="mytitle">
<script type="text/javascript">
x=document.getElementsByTagName('body')[0];
document.write("Body title: " + x.title);
document.write("<br />");
document.write("An alternate way: ");
document.write(document.getElementById('myid').title);
</script>
</body>
example2:
<a href="http://www.baidu.com/" title="begin XHTML study">XHTML学习</a>
说明
可以为链接,表单等元素提供额外的信息(HTML中所有元素都具有title属性),比如可以通过title属性详细介绍要链接到的页面的内容.
鼠标停留在链接或表单上面时,显示提示文字.
一些可以发音的浏览器,可以说出"title"里的内容
example3:
带换行的title测试
<div title="123 456">text</div>
<div title="123& #10;456">text</div>
<a href="" title="怎样强 制换行">留言</a>
<div title="I am a happy girl, I am very happy. I want to be happy forever.That's the words I want to say to everybody, I hope everyone will be happy every day.">long text</div>
ToolTip Torture Test
Tooltips can be very useful things, but there are a few intracies that most authors don’t understand how to take advantage of, and a few behaviors that are bugs in the various browser implementations.
Several attributes should cause a tooltip or similar display when the cursor is passed over an object with some or all of them. title should always display its contents, while alt should only be displayed when the image has not been loaded. I am not sure how longdesc should be handled; it is paired with alt in the HTML 4.01 specification, and seems designed to provide a textual description of the image in lieu of actually showing the image (primarially for blind people, perhaps), but the spec is silent on this, and it could be used simply as a means for providing an extended description or information about the image appropriate for all users. Therefore, it is my contention that this link should always be displayed.
TITLE & ALT
Move your mouse cursor over the checkmark, and you should see a tooltip with the phrase, “This is a checkmark.” displayed near the cursor. If it displays “checkmark image” instead, your browser is displaying the title attribute instead.
TITLE, ALT, & LONGDESC
This image should display a tooltip identical to the one above, but it should also have some sort of a hyperlink displayed near or attached to it. A URL is specified in the LONGDESC attribute of that image tag.
Really Long Text
This image has an extremely long text string specified as the ALT text. The string ends with “…will be gray.” and you should see that.
Ignoring Line Breaks
This image’s ALT text is four sentences, with a line break between each sentence. According to the HTML specification, these line breaks should be ignored, but Internet Explorer 6.0 interprets them; putting each sentence on a new line of the tooltip. This is both useful and problematic behavior—and very incorrect. The HTML specification should be modified to allow for simple formatting such as line breaks, bolding, and itallics.
Forcing Line Breaks
The HTML specification specifies that all linefeeds shall be ignored, but some method of indicating them in tooltips is needed. Two methods that occur to me are using 
 (Unicode NewLine) or /A (CSS2 escape sequence for a traditional newline).
Typesetting Character Entities
This tooltip should contain several typesetting characters, including an em dash after checkmark, a built fraction for 1/4 and double prime for 1/4 inch, curly quotes around feature chart, and an ellipsis at the end.
UTF-8 Typesetting Characters
This tooltip should contain several typesetting characters, including an em dash after checkmark, a built fraction for 1/4 and double prime for 1/4 inch, curly quotes around feature chart, and an ellipsis at the end.
大概的意思是,XHTML DTD定义title属性为一个CDATA,而根据SGML里CDATA的定义,浏览器应该:替换所有html实体;忽略LF字符;替换所有CR字符和tab字符为一个空格。
按照W3C的说法,执行这3步后,所有的CR和LF字符已经他们的html实体都已消失或变成空格了。看起来在title里换行变成不可能的事了。不过,Firefox好像并没有转换CR字符为空格,而是把CR给忽略了。而LF字符倒是没有被处理,直接换行了。上面的代码,不用UNIX行尾符LF,而是用Mac行尾符CR,在IE下还能换行,但是在Firefox下,CR字符直接被忽略了。我还是很想通过W3C的验证,所以做了一下测试,使用LF字符或者LF的html实体& #10;都是可以的。网上流传说可以用CR的html实体& #13;,其实只是IE中可以,Firefox下一样不行。如果不追求符合W3C,那还不如直接把字符串转成UNIX行尾符输出呢
还有,title里有小于号和单引号好像并不要紧,但是有双引号就不行了。这么说来,把字符串里的换行和双引号给替换一下输出就行了?go on learning...
发表评论
-
window.open()的所有参数列表
2010-08-17 10:42 727【1、最基本的弹出窗口 ... -
javascript IE firefox兼容性
2010-06-22 17:34 1606以下以 IE 代替 Internet Explorer,以 M ... -
js的引号多级嵌套
2010-05-19 13:47 15149今天遇到一个bug,就是引号码层嵌套的问题 var subTa ... -
加纵向滚动条
2010-05-14 11:12 1106version 1 <html> <head ... -
验证数字
2010-03-30 15:57 846function isValidCurrency(input) ... -
IE vs firefox
2010-03-25 12:17 1070IE有children,FireFox没有 document. ... -
window.open()的所有参数列表
2009-01-08 14:12 815前言:经常上网的朋友可能会到过这样一些网站,一进入首页立刻会弹 ... -
offsetParent和parentElement的区别
2009-01-08 10:20 1456一直以为offsetParent和parentElement是 ... -
setInterval(),clearInterval
2008-12-16 18:00 1792setInterval() 设置浏览器每隔多长时间以后调用指定 ... -
dom中的children对象数组元素 fistChild,lastChild使用
2008-12-04 17:26 3154children对象数组元素示例 <html> & ... -
event.srcElement
2008-12-04 15:12 1011<body > <table heigh ... -
iframe调用父页面的javascript函数
2008-12-03 18:04 7580iframe调用父页面的javascript函数 paren ... -
Readonly和Disabled的区别
2008-12-02 15:58 4716Readonly和Disabled是用在表单中的两个属性,它们 ... -
获得焦点focus()使用example
2008-12-02 15:32 1855<%@ page contentType="t ... -
javascript:void(0) & 刷新页面
2008-12-02 10:36 37011 <a href="#" oncl ... -
document.all
2008-12-01 17:34 1302一. document.all是页面内所有元素的一个集合。例如 ... -
javascript中id和name的区别
2008-12-01 14:58 1812javascript中id和name的区别 id一般来说是唯一 ... -
javascript中的eval函数的用法
2008-12-01 14:56 1003javascript中的eval函数的 ... -
insertAdjacentHTML
2008-12-01 10:51 1961insertAdjacentHTML动态插入行2008-11- ... -
向后台传输json对象数组
2008-11-27 17:15 67511function setJson1() { var tbl ...
相关推荐
资产处理小工具,python3编写,功能简单,大佬勿喷,批量访问网址,并获取title 使用方法:scanport扫描出来的结果存入res.txt,可直接使用get_title.py获取title
实现title滚动和页面title滚动的方法多种多样,以下是两种常见的技术途径: 1. CSS3动画:利用CSS3的`@keyframes`规则,我们可以定义一个标题从一端移动到另一端的动画。通过设置`animation`属性,将这个动画应用到...
基本环境配置: webpack + vue2.0 + vue-router +nodeJS 进入 router 文件夹底下的index.js文件 首先引入: import Vue from 'vue' import Router from 'vue-... title: '首页入口' } }, { /* 修改昵称 */ path: '
为了更加规范和模块化,我们可以将设置title的方法导出为一个函数,使其能在其他部分的代码中被导入使用。此外,也可以利用Vue Router提供的afterEach钩子函数,在每次路由跳转后执行设置title的操作。afterEach钩子...
今天我们讨论的主题是“Python抽取指定url页面的title方法”,这是一个网络爬虫中非常常见的需求,即从网页源码中提取出网页的标题信息。 首先,要实现这个功能,我们需要了解两个Python中常用的模块:re和lxml。re...
否则,将使用默认的页面标题。 最后,为了使上述更改生效,别忘了在后台清除缓存。这样,所有步骤完成后,ECSHOP的商品详情页就能够显示自定义的TITLE,从而更好地展示商品信息,提高搜索引擎的可见性,同时也满足...
Test404轻量Title获取器 v2.0是一款专为网络优化和SEO专业人士设计的高效工具,其主要功能是快速地从互联网上批量获取网页的Title信息...然而,使用任何工具都应遵循正确的使用方法和道德规范,以保持良好的网络环境。
#### 二、设定Title位置的方法 1. **使用`'position'`属性**: - 默认情况下,`title`函数会将标题放置在坐标轴的顶部中央。 - 如果需要将标题放置在一个特定的位置,可以通过设置`'position'`属性来实现。 - `...
首先,`title`属性在HTML中的基本用法是在任何元素上添加,例如: ```html <a href="http://example.com" title="这是一个带有提示信息的链接">点击这里 ``` 当用户将鼠标悬停在链接上时,浏览器会显示"这是一个带...
5. **恢复原状**:若需恢复到初始标题,可以使用 `Title.reset()` 方法: ```javascript Title.reset(); ``` Title.js 的强大之处在于它的灵活性和易用性,开发者可以根据需求自由定制标题更新的行为。通过结合各种...
需要注意的是,虽然Title特效可以增加网站的吸引力,但过度使用或不恰当的使用可能会对用户体验造成负面影响。因此,设计Title特效时应考虑其适用性和用户体验,避免过于花哨或分散用户注意力。 总的来说,...
如果想要动态的去修改,需要使用如下的方法。 document.title = '这是一个标题'; 这样会让我们做很多无用功。显得十分蠢。 使用Vue-Router的方法 首先打开/src/router/index.js文件。 找到如下代码。 const vue...
在IT领域,特别是前端开发中,使用EasyUI框架来增强用户界面的功能性和美观性是一种常见的实践。EasyUI是一个基于jQuery的UI工具包,它提供了一系列的用户界面组件,如按钮、对话框、网格等,使得开发者能够快速地...
在代码中,我们可能会看到这样的用法: ```html <a href="https://www.example.com" title="访问示例网站">点击这里 ``` 当鼠标停留在链接上时,"访问示例网站"会作为提示信息显示出来。默认情况下,这个提示信息...
pdf标题 pdftitle是提取PDF文章标题的小...安装 pip install pdftitle用法pdftitle -p 返回找到的文档标题。 $ pdftitle -p knuth65.pdf On the Translation of Languages from Left to Rightpdftitle -p <pdf-fi
"很好,很强大的title弹出提示"这个标题暗示了我们即将探讨一个能够增强网页提示功能的方法,即利用sweet-titles-for-jquery插件。这个插件允许开发者为网页元素添加动态、美观的title提示效果,以更吸引人的形式...
然而,这种方法对于大型项目来说并不理想,因为每个视图都需要独立维护标题,容易导致代码重复且不易维护。 为了解决这个问题,我们可以创建一个全局的帮助器函数或者使用View Composer来集中管理页面标题。以下是...
-- 如果使用的是AndroidX库,则使用以下代码 --> <!-- <item name="titleTextStyle">@style/CenteredTitleStyle</item> --> ``` 2. **定义标题样式**: 接下来,我们需要创建一个自定义的标题样式`...
这个“title及alt提示个性化特效”可能包含了一种使用JavaScript来增强这两种属性表现方式的方法。JavaScript是一种强大的客户端脚本语言,可以在用户与网页交互时动态改变网页内容。通过JavaScript,开发者可以实现...
下面我们将深入探讨这个插件的基本原理、使用方法以及它的核心特性。 一、jQuery TipTipv13简介 TipTipv13是基于jQuery库的一个插件,它的主要功能是将HTML元素的`title`属性内容以更美观、可定制的方式展现出来,...