如何限制强标记的字符数? [英] how to limit the number of characters for strong tag?

查看:98
本文介绍了如何限制强标记的字符数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我如何限制产品名称的ccharacters数量。

我的意思是: http://

laptopsisland.com/shop/c/netbooks/



有些产品名称非常大,因此,iam可以看到'现在购物'(当我将它悬停时)



这是我用于产品名称的代码:< strong class =below-thumb> ; [product.name]< / strong>



我在google中试过如何限制强标记的字符数量,但我没有找到..对不起,iam没有太多的gud在html,..所以任何人都可以..?



对不起,如果它是一个noob qquestion ..

解决方案

你不能.strong标签定义了一个重要的文本。无论您在strong标签内的文字是什么,都会显示出来。如果要限制字符数使用文本框。试试这个:

 < input type =textclass =below-thumbvalue =product_namemaxlength = 10\" > 

希望这可以帮助您。



更新:要设置文本框不可用并删除边框,请将这些代码行添加为文本框的属性。

  readonly =readonlystyle =border:0px


can anyone pls tell me "how to limit the number of ccharacters for a product name"

I mean here: http://laptopsisland.com/shop/c/netbooks/

Some product names are very big, because of that, iam uanble to see 'shop now' (when I hover it)

This is the code i used for the product name: <strong class="below-thumb">[product.name]</strong>

I tried in google 'how to limit number of charaters for strong tag' , but i didnt found.. iam sorry that iam not much gud at html,.. so anyone can..?

sorry if its a noob qquestion..

解决方案

you can't..strong tag defines an important text. Whatever your text inside the strong tag will be diplayed. If you want to limit the number of characters use text box. try this:

<input type="text" class="below-thumb" value="product_name" maxlength="10">

hope this helps you out.

UPDATE: to set the textbox ineditable and remove the border, add these line of codes as an attribute to your textbox.

readonly="readonly" style="border:0px"

这篇关于如何限制强标记的字符数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆